Using a time loop to find High or Low during defined period

Forums ProRealTime English forum ProBuilder support Using a time loop to find High or Low during defined period

Viewing 5 posts - 1 through 5 (of 5 total)
  • #42158

    I would like to find out how to find a high or low within a defined area.  To test, I used the example code below but probuilder tells me there’s a syntax error in line 14 – there are only 13 lines of code.

    It would be great if someone could let me know what I’m missing or point me towards code that would allow me to do this…

    #42161

    A FOR/NEXT loop is always made with 3 keywords: FOR + DO + NEXT

    The correct syntax should be:

    But you don’t have to do a loop to find the highest high of 20 bars ago, you could also use this instruction:

    it will find for you, the value of the highest high 25 periods but 20 bars ago.

    #42167

    @Nicolas I have always used the formula you referenced to but at some point realized that for some unknown reason it doesn’t give the same result as a loop. For example:

    Should yield the same result as:

    And unless I am mistaken it doesn’t?

    #42182

    @juanj

    Because you are using “elsif”, you should make 2 different conditional statement IF/ENDIF, one for highest high and one for lowest low.

    #42282

    Thank you all for your excellent advice … problem solved.

Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login