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).
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue