How timezone correct for tick request in the Python integration?

 

I'm about this. Quote:

# create 'datetime' objects in UTC time zone to avoid the implementation of a local time zone offset

But really not important server time zone here? I'm afraid that I can get problem in the future and I'm not understand how server works with timezone ... Why is UTC is using here? It's his server time zone or need to use UTC always?

Documentation on MQL5: Integration / MetaTrader for Python / copy_ticks_range
Documentation on MQL5: Integration / MetaTrader for Python / copy_ticks_range
  • www.mql5.com
copy_ticks_range - MetaTrader for Python - Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Anybody?
 
sergey087 #:
Anybody?

Have you run the code? It was clearly written by someone who knows this area intricately, so if it works don't change it or worry about it

 
R4tna C #:

Have you run the code? It was clearly written by someone who knows this area intricately, so if it works don't change it or worry about it

Yes, it's works! But I not understand - how it's works :(

 
sergey087 #:

Yes, it's works! But I not understand - how it's works :(

The documentation explains more:

When creating the 'datetime' object, Python uses the local time zone, while MetaTrader 5 stores tick and bar open time in UTC time zone (without the shift). Therefore, 'datetime' should be created in UTC time for executing functions that use time. The data obtained from MetaTrader 5 have UTC time, but Python applies the local time shift again when trying to print them. Thus, the obtained data should also be corrected for visual presentation.
 
R4tna C #:

The documentation explains more:

When creating the 'datetime' object, Python uses the local time zone, while MetaTrader 5 stores tick and bar open time in UTC time zone (without the shift). Therefore, 'datetime' should be created in UTC time for executing functions that use time. The data obtained from MetaTrader 5 have UTC time, but Python applies the local time shift again when trying to print them. Thus, the obtained data should also be corrected for visual presentation.

Thank you very much! It's describe all that they are do in the example :) UTC is really must have here ....