TimeGMT() issue while backtest?

 

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 time.



 
GumRai:

From the documentation


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.

 
sheriffonline:

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.


I doubt it. I have avoided using GMT time so far as most people don't understand what it is
 
sheriffonline:

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.

 
sheriffonline:

.. 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).

 
sheriffonline: Is there any trick to see real GMT time while backtest?
No! You can change server time to GMT time using a constant offset, but you must verify server doesn't change DST during the run.
Reason: