Announcement

Collapse
No announcement yet.

What is the recommended way in strategy to check for highest high of indicator?

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

  • What is the recommended way in strategy to check for highest high of indicator?

    From within a strategy I want to test for the highest high of an indicator value for a certain nember of periods. Somewhat similiar to what a Donchian strategy does for price.

    Can you offer any suggestions. I ran across the hh and ll helper functions but it's unclear to me how to apply these to an indicator value?

    I don't know if the donchian strategies listed in this forum can be applied to indicator values, rsi, etc.

    To extract, store, and process these values in an array myself within the strategy is a bit beyond my efs expertise.

    Thanks very much....
    Last edited by demarcog; 10-07-2005, 09:22 AM.
    Glen Demarco
    [email protected]

  • #2
    demarcog
    You can use hhv() or highest() or upperDonchian() indifferently and the syntax would be similar to all three. If for example you wanted the highest value of the rsi(14) in the last 20 bars you could use
    hhv(20,rsi(14)) or highest(20,rsi(14)) or upperDonchian(20,rsi(14))
    The same applies to llv(), lowest() and lowerDonchian().
    Alex

    Comment


    • #3
      Thanks Alex, I appreciate it and when I crack this currency market, in terms of finding soemthing that pulls money out (and despite my occasional despondence, I'm actually making amazing progress), I will never forget the help you have given me and repay it in spades dude and you can bank on it....
      Glen Demarco
      [email protected]

      Comment


      • #4
        Does this look like a correct statement to test if the current value for ADX is greater than or equal the the highest 14 period adx for the last 20 intervals? Unless I have a logic error the test looks like it's never TRUE and the code falls through the test.


        vADXDM.getValue(ADXDMStudy.ADX) >= hhv(20,vADXDM.getValue(ADXDMStudy.ADX)(14)
        Glen Demarco
        [email protected]

        Comment


        • #5
          demarcog
          You are mixing EFS1 and EFS2 functions which cannot be done. You need to use only the EFS2 functions.
          At this point I would strongly suggest that you take some time to go through the EFS2 Function Reference in the EFS KnowledgeBase so as to familiarize yourself with the required syntax
          Alex

          Comment


          • #6
            I looked through the documentation which is quite extensive:

            do this look like a correct statement?

            if ( myvar1 >= hhv(20,adx(14,14) )
            Glen Demarco
            [email protected]

            Comment


            • #7
              demarcog
              That is correct. However if myVar1 is the adx(14,14) study then by definition it will never be > hhv(20,adx(14,14) because hhv(20,adx(14,14) includes the current value of adx(14,14). Hence you would need to set the conditions as in the following example
              Alex

              PHP Code:
              var myADX adx(14,14);//this creates the adx series
              var HHVmyADX hhv(10,myADX);//the hhv function then uses the myADX variable (which is a series)
              //OR  
              //var HHVmyADX = hhv(10,adx(14,14));//you can create it directly
                  
              //THEN
                  
              //to check for a breach of HHVmyADX
              if(myADX.getValue(0)>HHVmyADX.getValue(-1)){
                  
              //execute a command
              }
                      
              //you need to check against the value of HHVmyADX at the prior bar ie HHVmyADX.getValue(-1)
              //because by definition myADX will never be greater than the current value of HHVmyADX 

              Comment

              Working...
              X