Announcement

Collapse
No announcement yet.

Highest High Entry

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

  • Highest High Entry

    Lets say I wanted to enter when the high of the current bar is the highest high of the last 20 bars.
    I hoped this would work:
    if ( high() > hhv(20 high()) )
    But since the current bar is part of HHV it can enver get triggered.
    I tried:
    if ( high() == hhv(20, high()) )
    but that has me entering on doube-tops!

    The syntax defintion for "hhv" doesn't seem to have an offset liek "-1" so I wouldn't be including the current price bar, thereby having a true breakout entry.

    Could someone recommend the syntax for entering on a 20 bar breakout?
    Good Trading,
    Yuri Shramenko

  • #2
    Yuri
    See this thread. FYI I found it by searching the forums for highest
    Alex

    Comment


    • #3
      Highest High

      I have this function to make a buy signal, if the 4EMA corsses the 9EMA.

      I now want to ad that this is only true if the high of the current bar goes over the highest high of the last 10 days.....i tryed to arrange this now since 2 hours....could you help me!?

      *******************************************
      function main() {

      if (
      vEMA4.getValue(MAStudy.MA) > vEMA9.getValue(MAStudy.MA)
      ) onAction1()

      ********************************************
      i tryed this but it doesn´t work

      function main() {

      if (
      vEMA4.getValue(MAStudy.MA) > vEMA9.getValue(MAStudy.MA) &&
      high() > hhv ( 10, High(-1))
      ) onAction1()

      Comment


      • #4
        mautz
        Try using the code enclosed below. Note that this is the same logic shown at the link I suggested in my previous reply in this thread.
        Alex

        PHP Code:
        var Highest hhv(10,high())
        if (
        vEMA4.getValue(MAStudy.MA) > vEMA9.getValue(MAStudy.MA) &&
            
        high(0) > Highest.getValue(-1))
                
        onAction1(); 

        Comment


        • #5
          THX

          thank you very much for your help!!

          Comment


          • #6
            mautz
            You are most welcome
            Alex

            Comment

            Working...
            X