Finding the High of a series of bars

Forums ProRealTime English forum ProOrder support Finding the High of a series of bars

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

    How do. I find the High of a series of bars.

    say countofpostions = 10

    How can I find the Maximum (or highest) of the High of the bar when countofpositions became 10 and the High of the current bar (and subsequent bar when that happens).

    Thank you

    #251836

    You can use the HIGHEST function in ProBuilder to find the maximum of the last N bars.
    In your case, if you want to get the highest value of the High over the last 10 bars, you can do it like this:

    1 user thanked author for this post.
    #251842

    Hi,

    the request is slightly ambiguous because you don’t use the same spelling for countofposition as an existing proorder keyword, so it might give the impression you meant it as a variable for the series length, but it could be you really meant “when my position reaches size 10”:

    https://www.prorealcode.com/documentation/countofposition/

    so, assuming the latter and using countofposition as the above proorder command counting your number of contracts/shares (so spelling with no “s”, and adding the missing “i”) rather than a personal variable, then you could try this to find highest value of both highs, regardless of how long it took between reaching size 10 and current bar (NB: this piece of code doesn’t extrapolate on your behalf what value to give to “myhighest” after countofposition is not 10 anymore):

     

     

    1 user thanked author for this post.
    #251932

    Thanks for replies. The situation is for when countposition equals a certain number.

    Does TradeIndex(1) help here.

    Would

    If Countposition = 10 Then
    MaxH = Highest[TradeIndex(1)-Barindex +1]

    Endif

    work?

    Thank You

     

    #252009

    Maybe this one?

     

     

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