Announcement

Collapse
No announcement yet.

Highest high Lowest Low

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

  • Highest high Lowest Low

    I am trying to write an efs study to show me the breakout of the Highest high or lowest low of 20 bars. I used the wizard and had 20 lines of rules for each which got very slow to run.

    There must be a better way to code it.

    Any help would be appreciated.

    Thanks,
    Ed

  • #2
    Ed
    Use the Donchian Study in the Formula Wizard and set it to Length 20 and Offset 1
    Alex

    Comment


    • #3
      Alexis,
      what exactly is the purpose of the "offset" input in the Donchian script calculation? is it really necessary or is it specific to the entry type eg. "on close"? Could the offset be eliminated if one were entering at a specified stop level? New to EFS -- thanks.

      Comment


      • #4
        c_13
        With the Donchian channel the high or low of a bar are actually never higher or lower than the channel itself. This means that in a formula you would need to reference the value of the Donchian at the prior bar to define a breakout/breakdown
        Applying an offset simply shifts the channel (forward in this specific case) and makes it easier to write the conditions as everything will then be related to the current bar.
        If for example you wanted to define a breakout without applying an offset you would need to write the condition in the following way
        IF(high(current bar)>DonchianUpper(prior bar))
        If instead you applied a forward offset of one bar then the same statement would be
        IF(high(current bar)>DonchianUpper(current bar))
        Hope this helps
        Alex

        Comment


        • #5
          thanks Alexis, this helps my understanding of Donchian and how EFS deals with the code. I wanted to set entry levels equal to this channel calculation for use as a stop-in limit entry. It sounds like I will have to shift this offset back to have the desired entry. Is this (somewhat) correct?


          thanks

          c_13

          some more detail:

          This is what I am trying to accomplish (more or less):

          Long Entry = "Highest High" of "lookback"
          Long Exit = "Lowest Low" of "lookback"

          I want to make these "Long Entry" and "Long Exit" levels stops (which are calculated by EFS) that I will enter and exit upon. Do you know where I might find examples of this sort of entry method? I have been looking at the file share and posting board but have not had a great deal of luck.
          Last edited by c_13; 02-18-2004, 06:16 AM.

          Comment


          • #6
            c_13
            If you shift the channel back then you will have no current value for it. I suspect that you may want to shift it forward. If you can post an example of what you are trying to do someone should be able to offer suggestions
            Alex

            Comment


            • #7
              c_13
              Attached is an example of what I think you are trying to do. You can modify all the parameters of the Donchian channel. The "lookback" as defined by you is essentially the Length of the channel itself (default is 20).
              The efs in this case is always Long or Short but that can be easily adapted to your strategy by replacing the conditions !Strategy.isShort() with Strategy.isLong() and Strategy.doShort with Strategy.doSell
              Alex
              Attached Files

              Comment


              • #8
                thanks again Alexis, I will work on/with this.


                c_13

                Comment


                • #9
                  c_13
                  You are welcome.
                  Also you may want to see this thread for some variations on this or related efs.
                  Alex

                  Comment


                  • #10
                    I want to look at the highest high and lowest low level of the last 20 bar lookback period. This is my attempt but as you can see it only looks to be considering the bar prior and not keeping track of the max and min levels of the period
                    Can you see what I am missing? Is it my return command that causes it to recalculate -- thanks

                    attached EFS: try
                    Attached Files

                    Comment


                    • #11
                      c_13
                      If I were taking the long route or I needed to find the highest/lowest value of a variable that cannot be used in a builtin study then the attached efs is what I would do.
                      Otherwise I would use the Donchian Study as IMHO it simplifies the script considerably.
                      Just an opinion
                      Alex
                      Attached Files

                      Comment


                      • #12
                        Alex,

                        I inserted in "Donchian strategy (3b) wizard.efs" the following line for the email alert:

                        Alert.email (CLOSE (), "sell");

                        if you can supplement me please the line, thus also the triggered price in the email comes in the line for reference text.


                        Thank you in advance.

                        -----------------------------------
                        Rodondo

                        Comment


                        • #13
                          Rodondo
                          Please post the efs you are referring to or a link to it
                          Alex

                          Comment


                          • #14
                            Alex,

                            enclosed I send the "efs" to you.

                            Many greetings
                            ---------------------------------------------
                            Rodondo
                            Attached Files

                            Comment


                            • #15
                              Rodondo
                              The efs you posted is blank. You may want to try again
                              Alex

                              Comment

                              Working...
                              X