MetaQuotes-Demo — MT5 Python Historical Order and Deal Coverage

Hello,

I'm developing a Python application using the official MetaTrader 5 Python package and need clarification about historical trading data available on the MetaQuotes-Demo server.

Could you please clarify:

  1. How far back can history_orders_get() and history_deals_get() retrieve records on this server?

  2. Are there query date-range limits, maximum result sizes, or truncation risks?

  3. Does a successful query guarantee that all orders and deals within the requested period are returned?

  4. Does an empty result guarantee that no matching order or deal exists, or can records be delayed or unavailable?

  5. Is there an official way to verify that a requested history interval is complete?

If these questions must be answered by the server administrator rather than MetaQuotes, please direct me to the appropriate contact.

Thank you.

Ask your AI agent to READ the forum BEFORE posting.
Python history_orders_get() and history_deals_get()  can retrieve the earliest number of historical orders, depending on whether you have selected all history in the MT5 client history. When you do this, the trading history will be saved in \ bases \ ICMarketsSC Demo \ trades \ 51920218\ Python reads the records from here, and if the data exceeds the time range here, it will not be able to return the correct records. When reading the history, Python is different from MQL5 EA. MQL5 EA can force a specified time period to download and return the records from a remote server, while Python can only read the existing records from \bases \ ICMarketsSC Demo \ trades \ 51920218\ on the local machine. This is also the result I have obtained after many tests
Chunlei Zhang #:
Python history_orders_get() and history_deals_get()  can retrieve the earliest number of historical orders, depending on whether you have selected all history in the MT5 client history. When you do this, the trading history will be saved in \ bases \ ICMarketsSC Demo \ trades \ 51920218\ Python reads the records from here, and if the data exceeds the time range here, it will not be able to return the correct records. When reading the history, Python is different from MQL5 EA. MQL5 EA can force a specified time period to download and return the records from a remote server, while Python can only read the existing records from \bases \ ICMarketsSC Demo \ trades \ 51920218\ on the local machine. This is also the result I have obtained after many tests

Could you clarify whether you have verified this behavior specifically on the MetaQuotes-Demo server, or only on ICMarketsSC Demo?

In particular, is there an official MetaQuotes reference confirming that the Python API reads historical orders and deals exclusively from locally cached terminal history, and that selecting “All History” is required to retrieve the full available range?

I want to avoid treating an empty or incomplete local history result as proof that a submission was never accepted.

Verd Bansah #:

I want to avoid treating an empty or incomplete local history result as proof that a submission was never accepted.

Here is the documentation:

MQL5 Book: Reading the history of orders and deals / Advanced language tools
MQL5 Book: Reading the history of orders and deals / Advanced language tools
  • www.mql5.com
Working with orders and deals in the account history using Python scripts is also possible. For these purposes, there are functions...