- MT4 backtesting and time zones
- Open Close High Low
- GMT Offset to generate candle ?
https://www.mql5.com/en/code/48419
datetime converted = CTimeZoneInfo::ConvertTimeForPlace(ticktime, ZONE_ID_UTC, ZONE_ID_BROKER);
This will handle conversions take into consideration, ICMarkets GMT offset and daylight changes on the server.
For backtesting additionally, include TimeGMT.mqh library

- www.mql5.com
Use ConvertTimeForPlace() from TimeZoneInfo.mqh
https://www.mql5.com/en/code/48419
This will handle conversions take into consideration, ICMarkets GMT offset and daylight changes on the server.
For backtesting additionally, include TimeGMT.mqh library
Thank you very much! I had already seen that library but I didn't know it included that function.
I have one last question, does ConvertTimeForPlace() include the DST? or do you have to do some other configuration?
I literally just need to identify that I am in x utc time.
thanks again.
I have one last question, does ConvertTimeForPlace() include the DST? or do you have to do some other configuration?
No configurations needed at all. DST will be handled automatically.
All you need to do is to make sure the time conversions are done on the broker's terminal (ICmarkets in your case).
Just follow the examples on the codebase, sure you will find one that fits your needs.
Edit:
Additional details:
Your broker is GMT+2 standard time (and GMT+3 in summer), the broker follows the US daylight savings schedule.
DST_US : server dst begins on the second Sunday of March (+1) and ends on the first Sunday of November (-1).
All these details are handled automatically.
No configurations needed at all. DST will be handled automatically.
All you need to do is to make sure the time conversions are done on the broker's terminal (ICmarkets in your case).
Just follow the examples on the codebase, sure you will find one that fits your needs.
Edit:
Additional details:
Your broker is GMT+2 standard time (and GMT+3 in summer), the broker follows the US daylight savings schedule.
DST_US : server dst begins on the second Sunday of March (+1) and ends on the first Sunday of November (-1).
All these details are handled automatically.
You are incredible! Thx!!!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use