Possibility to count number of bars since a given condition

Forums ProRealTime English forum ProOrder support Possibility to count number of bars since a given condition

Viewing 3 posts - 1 through 3 (of 3 total)
  • #67465

    Hello Everyone,

    I would like to ask for your help as for the following issue: is there any code that would let me calculating a number of bars since supertrend indicator was crossed by the price? The beginning of my code is:

    If close crosses over supertrend then “rise”

    Now the issue is that based on prorealtime handbook, i cannot use barindex to calculate the number of bars starting from the point when price crossed over supertrend.

    Thank you in advance for your help.

    Kind regards,

    Kemel

    #67470
    Leo

    Hi, create a variable where to save the moment of crossing. That moment is BarIndex

    like:

     

    1 user thanked author for this post.
    #167816

    Thanks

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

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