Get ticks for the specified date range from the MetaTrader 5 terminal.
[in] Financial instrument name, for example, "EURUSD".
[in] Date the ticks are requested from. Set by the 'datetime' object or as a number of seconds elapsed since 1970.01.01.
[in] Date, up to which the ticks are requested. Set by the 'datetime' object or as a number of seconds elapsed since 1970.01.01.
[in] A flag to define the type of the requested ticks. MT5_COPY_TICKS_INFO – ticks with Bid and/or Ask changes, MT5_COPY_TICKS_TRADE – ticks with changes in Last and Volume, MT5_COPY_TICKS_ALL – all ticks. Flag values are described in the MT5_COPY_TICKS enumeration.
Returns ticks in the form of tuples (time, bid, ask, last, flags). In the tuple, the flags variable can be a combination of flags from the MT5_TICK_FLAG enumeration.
See the CopyTicks function for more information.
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.