You are mixing up the concepts of local time and trade server time. They are not necessarily the same.
Trade servers can use completely different time-zone and DST.
Look at the time legend at the bottom of the MT5 chart.
You are mixing up the concepts of local time and trade server time. They are not necessarily the same.
Trade servers can use completely different time-zone and DST.
Look at the time legend at the bottom of the MT5 chart.
You are mixing up the concepts of local time and trade server time. They are not necessarily the same.
Trade servers can use completely different time-zone and DST.
Look at the time legend at the bottom of the MT5 chart.
- www.mql5.com
Some problems arise still. To determine the timezone of the MT5 server or the UTC offset from python, I see a previous suggestion was to wait for a tick to arrive, then compare the time of tick with the current local time, and use that difference to calculate the offset. However, how do I receive a most recent tick? That's the entire goal! I just want to receive the most recent ticks available, but I can only receive ticks from the specified time, in this case time.now() of my local time zone (which results in the problem originally mentioned in this thread). Without knowing the offset, there is no way for me to retrieve the latest tick from MT5's server time? Do I really have to hardcode the time zone and adjust it everytime DST comes about?
I tried symbol_info_tick; do you have any idea why the server time received with this method is 7 hours behind GMT+2? On both MetaQuotes server and Oanda server, somehow the apparent server time, the latest tick via symbol_info_tick is EST timezone, despite MetaTrader (the candles and Market Watch) showing as GMT+2. 7h ahead. It makes no sense to me.
As a side, the following code ideally would print the last 200 ticks for each currency. What I get, however, is an incomplete list of ticks, printing anywhere from 1 to 15 ticks, but never 200. If I use my local time time.time() instead of server_time, then it prints the full 200 ticks every time.
latest_tick = mt5.symbol_info_tick("EURUSD") server_time = latest_tick.time # e.g. UNIX 1705647839 for currency in currencies_list: ticks = mt5.copy_ticks_from(currency, server_time, 200, mt5.COPY_TICKS_INFO) print(ticks)
I tried symbol_info_tick; do you have any idea why the server time received with this method is 7 hours behind GMT+2? On both MetaQuotes server and Oanda server, somehow the apparent server time, the latest tick via symbol_info_tick is EST timezone, despite MetaTrader (the candles and Market Watch) showing as GMT+2. 7h ahead. It makes no sense to me.
As a side, the following code ideally would print the last 200 ticks for each currency. What I get, however, is an incomplete list of ticks, printing anywhere from 1 to 15 ticks, but never 200. If I use my local time time.time() instead of server_time, then it prints the full 200 ticks every time.
I'm looking on the "About" section in MetaTrader and it states Version: 5.00 build 4150, 18 Jan 2024. Is this not the most updated build? The problem persists.
Edit: Problem persists on build 4153, Jan 22 2024- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Very simple, I'm retrieving tick data as follows:
which prints:
[ (1705508465, 96.753, 96.759, 96.756, 0, 1705508465232, 6, 0.)
I know I'm retrieving the "right" values, because the UNIX time is correct. Yet the tick value is completely off. In the attached image (5m timeframe), you can see the prices are all 96.90+, but for those same candles, the tick data is returning 96.755 and such. What is going on?