How do I restrict the code of my indicator to be executed across the last 100 bars only? I do not want the code to be executed over the entire number of bars on the chart. ONLY the last 100 bars.
I am new to ProBuilder coding language and would appreciate any assistance to my question.
Seems quite difficult, since the history is only loaded once and at that time we can’t know if the current bar is the last (the current candlestick) is really the last one. So even with a loop, I have no solution now .. If you are using the 10.3 version, you could make a loop through the last 100 bars only while restricting your indicator to launch its calculation only at last bar (drawonlastbaronly).
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.