I run my EA om gmt time settings. but when i do backtest, eatakes local/server time?
what could be the issue? Is forward tests will work on GMT time?
datetime GMTDay = TimeGMT();
int hour0 = TimeHour(GMTDay);
int minute0 = TimeMinute(GMTDay);
if (DayOfWeek() != Today && hour0 == 1 && minute0 == 1)
Today = DayOfWeek();
From the documentation
During testing in the Strategy Tester, TimeGMT() is always equal to TimeCurrent() simulated server
Thanks for your support GumRai, Is there any trick to see real GMT time while backtest? bcoz while i backtest with different ea it gives wrong trades due to mis trading time , when it takes server time.
Anything to do with GMT via the on MetaTrader functions is not quite what they seem because the GMT offsets are taken from your local machine settings not the MetaTrader server machine (where the chart candles are formed).
Therefore you have to be careful when applying any automatic GMT offsets or Daylight savings.
.. Is there any trick to see real GMT time while backtest? ...
Have a list of dates of the USD-DST? Now if you are sure that your quotes always start on Forex-Open time (NY 17:00) you can calculate the GMT-Offset of your broker at the very first tick after the weekend.
Can't remember exactly but something like (first tick!!): TimeCurrent() = (BrokerOpenTimeGMT - BrokerGMTOffset) = NY_17:00 + USD-DST + NY-GMTOffset(+5h).