You are assuming that your Broker's trade server is using GMT time-zone. That may not be the case.
Find your broker's time-zone first, and consider what the starting GMT time is for the current bar as per your broker's time-zone.
-
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor -
double range_day = iHigh(_Symbol,PERIOD_D1,0) - 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 - MQL4 programming forum - Page 3 #26.4 (2019)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This code run one time at 18:50 gmt time. Every single day all the values are not correct.
range_day gives me always the past day range.
How thats even possible?