1. Check journal tab for possible error messages printed in tester mode.
2. Make sure you are applying the right setup in Indicator Properties.
If "i" represents the most recent bar(in case i=0) and you are using it to name your arrow object, it is pretty much expected that arrows will be replaced by arrows while they should not.
Anyway we need whole source code to find the problem and solution.
If the loop is using prev_calculated as the starting point, this could be your problem with the strategy tester. This parameter does not bode well with the strategy tester unless it is handled very carefully like in this code:
https://www.mql5.com/en/code/14669
as a workaround try starting the loop at "rates_total-500" or something like that

- www.mql5.com
Exactly.
Do not use series index in object names, as they are not unique. As soon as a new bar starts, you will be trying to create a new name (e.g., “name0”), same, existing, previous, name (e.g., “name0” now on bar one.)
Use time (as int) or a non-series index:
#define SERIES(I) (Bars - 1 - I) // As-series to non-series or back.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use