server time in live or backtesting mode

 

Hello there, from testing I can see, that the "server time" changes in "backtesting" mode.

Example: when I perform test on historical data, the server time corresponds to my time zone.

If I put the same Expert Advisor on a lice chart, the server time is one hour ahead of my time zone.

Question: is there an indicator at runtime which allows me to check, if the program is in "historical testing" or in "live" mode?

thanks a lot in advance for your help!!

 
  1. KjLNi: Example: when I perform test on historical data, the server time corresponds to my time zone.

    No, it does not. Your time zone is irrelevant. The documentation clearly says that local time is set to server time during testing; nothing more.

    timezone - Price Chart - General - MQL5 programming forum - Page 2

  2. KjLNi: Question: is there an indicator at runtime which allows me to check, if the program is in "historical testing" or in "live" mode?
    1. Why do you care? Other than diagnostics during non-live/non-optimizer modes, you shouldn't be doing anything different.
    2. Test for it.
                Detect optimization mode programmatically - Expert Advisors - MQL5 programming forum (2020)
 
KjLNi: Example: when I perform test on historical data, the server time corresponds to my time zone.

This can only happen if you are testing against imported data from a 3rd party (e.g. Dukascopy tick data) and you have set the incorrect time-zone for the imported data.

 
Fernando Carreiro #:

This can only happen if you are testing against imported data from a 3rd party (e.g. Dukascopy tick data) and you have set the incorrect time-zone for the imported data.

Hello there, it is true that I have observed this when I test with recommendations which are imported from a file. The time in those recommendations is a different time zone than the server time ...

Ok, but thanks for your input.

In the meantime, I have normalised everything for GMT Time Zone. GMT is available at runtime, both in backtesting and in live testing. So I just needed to make sure that my 

incoming recommendations are also in GMT, now it is working fine.

Just for reference, the source of recommendations which I use is different ...

Thanks and have a good time!!!

Reason: