CalulateOnLastBars

Forums ProRealTime English forum ProBuilder support CalulateOnLastBars

Viewing 2 posts - 1 through 2 (of 2 total)
  • #21609

    Hi

    I’d like to use functionality similar to DEFPARAM CALCULATEONLASTBARS in an indicator.  I want to be able to pass it a variable though (not hardcode a set number of bars to load).  I can’t find any way to do this though.  Alternatively is there a way to replicate this functionality within the indicator?   The indicator may be used on multiple different timeframes, so it is difficult to limit the calculation purely on date/time.

    Thank you

     

     

    #21658

    No variable can be used with any of the DEFPARAM instruction, I’m sorry.

    About your second question, you could use a DRAWONLASTBARONLY and then make a loop from there to calculate and display your indicator within the last X bars defined in the loop. A bit tricky if your indicator has already one or more FOR/NEXT loop built-in, but it could work as intended.

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

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