Can MQL5 uniquely determine the UTC open time of historical CopyRates bars?

Subject: Can MQL5 uniquely determine the UTC open time of historical CopyRates bars?

I would like to clarify the technical guarantees of MetaTrader 5 regarding historical bar timestamps.

This is a question about MQL5 API behavior, not trading strategy or a specific broker's DST policy.

Suppose a broker uses UTC+2 in winter and UTC+3 in summer.

  1. Does MqlRates.time, returned by CopyRates(), represent the broker's server-time bar opening label, or is it guaranteed to represent an absolute UTC instant?

  2. Is there any official MQL5 API or historical metadata that provides the broker's UTC offset applicable when a particular historical bar opened?

  3. If the broker's server clock moves backward at the end of DST and bars exist during the repeated hour, how does MT5 represent and distinguish those bars?

  4. After a terminal restart or historical data download, can the UTC opening time of each historical bar be uniquely reconstructed using only standard MQL5 APIs?

  5. Are these behaviors documented or guaranteed by MetaQuotes? If so, could you provide the relevant official documentation?

I understand that DST transitions often occur while the Forex market is closed. However, I am specifically asking about the guarantees of the platform and its historical timestamp representation, rather than assuming that no bars exist during a transition.

References:

https://www.mql5.com/en/docs/series/copyrates

https://www.mql5.com/en/docs/constants/structures/mqlrates

https://www.mql5.com/en/docs/dateandtime

Thank you for any technical clarification or authoritative references.

Documentation on MQL5: CopyRates / Timeseries and Indicators Access
Documentation on MQL5: CopyRates / Timeseries and Indicators Access
  • www.mql5.com
Gets history data of MqlRates structure of a specified symbol-period in specified quantity into the rates_array array. The elements ordering of the...
Alain Verleyen #:

Ask your AI to search for answers before posting.


Thank you very much, Sergey and Alain, for taking the time to respond.

Sergey, I appreciate you sharing the related discussions and references. I will read through them carefully.

Alain, thank you for clarifying that MT5 returns broker server time data. This is very helpful for understanding the timestamp behavior.

I sincerely appreciate both of your help and guidance.

Best regards.