Number of bars between two reference points

Forums ProRealTime English forum ProBuilder support Number of bars between two reference points

Viewing 7 posts - 1 through 7 (of 7 total)
  • #55481

    Hello,

    How do I find out the number of bars between two reference points is greater than X. Is there a function for this?

     

    Thanks.

    #55487

    Bars are identified by their time.

    You know what TF your strategy is running on, so in a 30-minute TF the difference between, say, 100000 and 113000 will return 3 bars elapsed.

    Is that what you meant?

    #55491

    Thanks for your reply Robertogozzi but not quite what I meant.

    I want to know if point B has moved more than x bars from point A, irrespective of time-frame.

    So for example, if an instrument has retraced more than 6 bars before detecting a bullish engulfing candle

     

    #55497

    I don’t know exactly what you mean, anyway when any event of your choice occurs tou may use BARINDEX to save that bar. At a later moment, whenever you choose to, you may retrueve that value and compare it to the caurrent BARINDEX to know exactly how many bars have elapsed.

    This is an example saving the bar number when an average crossing happens and computes the number of bars elapsed from then to the next crossing:

    Roberto

    #55501

    Thanks Roberto, BARINDEX is exactly what I’m looking for.

    #170083

    Hi Roberto,

    I have the highest high during intraday being drawn on current bar. If for example the highest high bar occurred x bars ago and that particular bar had another value drawn on it by an indicator.

    How do I make reference to that highest high bar (x bars ago) and have the code also show on current bar the value of the indicator on that x bar?

    #170091

    @IG_CFD_Trader

    Do not double post. You opened another topic.

    Thank you 🙂

     

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

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