Announcement

Collapse
No announcement yet.

Candlestick efs Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Candlestick efs Problem

    Hi,
    I created a very simple Candlestick Study using the Formula Wizard, and it doesn't seem to be updating correctly.

    Eg: The Image shows a green arrow on the last displayed candle, but no arrow should be displayed because only the > high and >= low criteria has been met, but not the close > open.

    The candle met all of the criteria earlier on, but then the arrow was still displayed when the candle changed bearish and all of the criteria was not met.


    Also, is there any way to have the arrows displayed on the presently forming candle only?


    Many thanks,
    Paul
    Attached Files

  • #2
    Here is the efs file.
    Attached Files

    Comment


    • #3
      Hi,

      The conditions fluctuate from true to false intra-bar as the bar develops (bar changes from up-bar to down-bar as it forms) so once one of the conditions is true, the corresponding arrow is plotted and since there is no code to remove it if the condition reverses intra-bar, the arrow remains.

      Hi,
      I created a very simple Candlestick Study using the Formula Wizard, and it doesn't seem to be updating correctly.

      Eg: The Image shows a green arrow on the last displayed candle, but no arrow should be displayed because only the > high and >= low criteria has been met, but not the close > open.

      The candle met all of the criteria earlier on, but then the arrow was still displayed when the candle changed bearish and all of the criteria was not met.


      Also, is there any way to have the arrows displayed on the presently forming candle only?
      In the attached efs, the arrow will seem to blink as the bar develops and the condition changes from true to false and will disappear once the bar is complete and a new bar starts to form.

      Important note: Because of the modifications I made, the Formula Wizard will no longer work with this efs.

      Wayne
      Attached Files
      Last edited by waynecd; 05-14-2010, 11:51 AM.

      Comment


      • #4
        Hi Wayne,

        The study works great. Thanks.

        Paul

        Comment


        • #5
          Hi Paul,

          Glad it worked.

          Wayne

          Comment


          • #6
            Hi wayne,

            Is the following alteration possible for this study:

            - At the moment, the "Arrow" is displayed when real-time data is being processed.

            - When I look at my longer term charts over the weekend (or if I turn the Data Manager off...etc), no real-time data is available, so the "Arrow" is not displayed.

            - Is it possible for the study to be shown even when no real-time data is being received - and - also work as it does now when real-time data is being processed?

            Thanks,
            Paul

            Comment


            • #7
              Hi Paul,

              When the market is closed it should plot the arrow below the most current bar if the condition is true. Of course if the condition is false then no arrow will show.

              If instead you intend for arrows to be shown for all candles when the market is closed (and not just the last bar) then in the menu of the attached file, select "true" for real time or "false" for when the market is closed (will show signals as appropriate for all loaded bars).

              Wayne
              Attached Files
              Last edited by waynecd; 05-19-2010, 09:24 AM.

              Comment


              • #8
                Hi Wayne,

                "When the market is closed it should plot the arrow below the most current bar if the condition is true. Of course if the condition is false then no arrow will show."

                - I closed the Data Manager down & tested this on Daily and Interval Charts where the Study condition was "true", but I could not get it to display any Arrow.


                "If instead you intend for arrows to be shown for all candles when the market is closed (and not just the last bar) then in the menu of the attached file, select "true" for real time or "false" for when the market is closed (will show signals as appropriate for all loaded bars)."

                - This works fine. Thanks.

                Paul

                Comment


                • #9
                  Hi Paul,

                  When the market is closed it should plot the arrow below the most current bar if the condition is true. Of course if the condition is false then no arrow will show.
                  The comment I made (above) is wrong.

                  The -function main()- will only execute on a new tick. So if the market is closed and no trades are coming through, then the efs does not execute on the current bar but it will on previous bars as they are formed (as the bars are loaded into the chart).

                  If the Data Manager is not running then you don't get any ticks whatsoever, not even historical plots if the Data Manager is not running when the chart is trying to load.

                  That is my understanding. Maybe someone that has a firm grip on this issue can clarify this for both of us.

                  Wayne
                  Last edited by waynecd; 05-19-2010, 01:03 PM.

                  Comment


                  • #10
                    Hi Wayne,

                    "The -function main()- will only execute on a new tick. So if the market is closed and no trades are coming through, then the efs does not execute on the current bar but it will on previous bars as they are formed (as the bars are loaded into the chart).

                    If the Data Manager is not running then you don't get any ticks whatsoever, not even historical plots if the Data Manager is not running when the chart is trying to load. "


                    - That's fine. I only required the alteration for chart analysis, and it would have made a nice addition to the study.

                    - I can simply use the Menu option you produced for chart analysis.

                    - The most important study feature is the real-time one you created for me in this thread, so thanks a lot for your assistance Wayne.

                    Paul

                    Comment


                    • #11
                      Re: Candlestick efs Problem

                      Paul
                      FWIW you can accomplish what you initially asked by using just the Formula Wizard.
                      Starting with your original formula you first modify the drawShape…() command in Set1 by adding a TagName (see yellow highlight in the following screenshot)



                      If this condition is true the formula will draw a green up arrow [the tagName of which is “arrow”] and will stop evaluating any subsequent conditions (this is because the Formula Wizard sets the conditions “in series” – for lack of a better term – by using if..else if…else if…etc which means that once any condition in the series is true this will stop the formula from evaluating the following conditions). Also since the tagName is not unique ie it is the same for all the green arrows drawn by this command only the last one will be drawn as there can only be one graphic object for each tagName.
                      Then you apply the same modification to Set2 as shown in the following image. Notice that the tagName is the same as that of Set1
                      If this condition is true the efs will draw a red down arrow and will stop evaluating any subsequent conditions
                      Because the tagName of this shape is the same as that of the green arrow it will remove the green arrow [if present] because as indicated also above there can only be one graphic object for each tagName



                      You then add a third condition that is by definition always true (eg 1 equal to 1) as shown in the next image.



                      This condition will be evaluated only if the prior two conditions are false ie when no arrow should be drawn. At that point the condition executes the removeShape() command to which you pass the tagName "arrow". Since this condition is always true it will remove whatever graphic object called "arrow" is drawn on the chart
                      So any time that neither condition in Set1 or Set2 is true this condition will execute the command to remove any drawn arrow
                      While the Formula Wizard may have limitations it is worthwhile to learn to use it because it can still provide you with some solutions.
                      Alex



                      Originally posted by TURLIES
                      Hi,
                      I created a very simple Candlestick Study using the Formula Wizard, and it doesn't seem to be updating correctly.

                      Eg: The Image shows a green arrow on the last displayed candle, but no arrow should be displayed because only the > high and >= low criteria has been met, but not the close > open.

                      The candle met all of the criteria earlier on, but then the arrow was still displayed when the candle changed bearish and all of the criteria was not met.


                      Also, is there any way to have the arrows displayed on the presently forming candle only?


                      Many thanks,
                      Paul

                      Comment


                      • #12
                        and the script is much more elegant.

                        Thanks Alex.

                        Wayne

                        Comment


                        • #13
                          That's great. Thanks Alex.

                          Paul

                          Comment


                          • #14
                            You are welcome
                            Alex


                            Originally posted by TURLIES
                            That's great. Thanks Alex.

                            Paul

                            Comment

                            Working...
                            X