MT5 Python API timestamp discrepancy: UTC vs server time

Title: MT5 Python API timestamp discrepancy: UTC vs server time (Build 6230)

Hello,

I am investigating a timestamp discrepancy in the MetaTrader 5 Python integration and would appreciate technical guidance on the expected timestamp behavior.

Environment

  • Operating system: Windows

  • Python package: MetaTrader5 5.0.6231

  • MT5 terminal build: 6230 (25 Sep 2026)

  • Broker: LiteFinance

  • Server: LiteFinance-MT5-Demo

  • Symbol: XAUUSD_o

  • Windows system clock: synchronized to UTC; local timezone UTC+03:30

  • Broker-confirmed server time on October 28, 2026: GMT+2

Observed behavior

On October 28, 2026, at approximately 08:33 UTC, I observed the following:

  1. datetime.now(timezone.utc) returned approximately 08:33 UTC.

  2. mt5.symbol_info_tick("XAUUSD_o") returned a time_msc value that, when interpreted as a Unix timestamp in UTC, corresponded to approximately 10:33 UTC.

  3. mt5.copy_rates_from_pos() returned recent M1 candles timestamped around 10:33 UTC.

  4. mt5.copy_rates_range(), when called with UTC-aware Python datetime arguments around 10:33 UTC, returned candles matching those from copy_rates_from_pos().

  5. mt5.copy_rates_range(), when called for the period around 08:33 UTC, returned different candles with different prices.

  6. mt5.copy_ticks_from() and mt5.copy_ticks_range(), using UTC-aware datetime arguments around 08:33 UTC, returned historical ticks timestamped around the requested time.

For example, a candle returned by copy_rates_from_pos() at 10:32 UTC had a close price of approximately 4049.96, while the candle returned by copy_rates_range() at 08:33 UTC had a close price of approximately 4030.44.

The results suggest that the timestamp handling or time interpretation may differ between these API functions.

The broker has confirmed its server timezone schedule but has referred me to MetaQuotes for clarification of the Python API behavior.

Questions

  1. Are the time and time_msc fields returned by symbol_info_tick() always Unix timestamps representing UTC?

  2. Are timestamps returned by copy_rates_from_pos(), copy_rates_range(), copy_ticks_from(), and copy_ticks_range() guaranteed to use the same UTC time basis?

  3. Should all datetime arguments passed to these history functions be explicitly expressed in UTC, regardless of the broker's server timezone?

  4. Is this behavior known in MT5 terminal build 6230 or Python package version 5.0.6231?

  5. Is there a recommended diagnostic procedure or known workaround to ensure consistent UTC timestamps across live ticks, historical ticks, and candle data?

I have not applied any timestamp correction to my application because I want to establish the correct behavior before modifying the code.

Thank you for your time and assistance.

Best regards