I have this indicator:
When I add it to an EA running in strategy tester, the indicator line varies at certain places. If I then stop the ea and reset the indicator, it corrects itself. In the screen shot the yellow line is when the indicator is dropped on the running strategy tester, the purple is shows when I just add it to the chart.
What am I doing wrong?
When rates_total-pre_calculated=0, limit =1 and the for loop will not execute
When rates_total-pre_calculated=1, when a new bar opens, limit =2 and the for loop will only calculate with bar
So in real time, the code will only execute for the first tick of a new bar. When you attach it it has access to bar close values