1) round(..) gets bigger and bigger and so the shift var in iATR(...,round()).
2) after some time you'll get beyond the starttest and the iATR will be zero and that causes the zero-devide 2 lines later - I guess.
the integer is just growing with the time. Its just the plan to count 1,2,3,.. with every day. I think its more problem with the format, isnt it? I dont understand your answer right now.
Ebery other idea that works in backtest? i tried it for a year with DayOfYear() and the backtest was worse than before without it. But isnt it necessary for a good EA because of the changing(for example middle 2014 very low, now higher)?
I think its just the Problem with the shift why i ask, but now in the afternoon i have woken up i think why i dont use the daily ATR as a Multiplier, why complicated..

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
i want to ask how you change your Sl & TP settings in a backtest over a longer time? I mean I personally cant always use RR for TP and SL (and because it makes the backtest very slow) because of the SL.
I tried it with this code:
But there is a a zero divide because of this part; when i use comment it shows the right integer, but it doesnt work here... What is the fault and other question: Does anybody have a better solution for changing TP,.. if Volatility changes?