int limit = MathMax(rates_total-prev_calculated,2); for (int i=1;i<limit-3;i++)What are thinking this is doing ?
-
int limit = MathMax(rates_total-prev_calculated,2); for (int i=1;i<limit-3;i++) ⋮ double c10r= High[i+10]-Low[i+10];
Do your lookbacks correctly. Your maximum lookback is ten (10.) Generally count down do you don't access future bar values.
How to do your lookbacks correctly #9 - #14 & #19 -
double CurrentDayLow= iLow(Symbol(), PERIOD_D1, 0);
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4

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