Discussing the article: "Python + MetaTrader 5: Fast Research Framework for Data, Features, and Prototypes"

 

Check out the new article: Python + MetaTrader 5: Fast Research Framework for Data, Features, and Prototypes.

The article demonstrates how Python and MetaTrader 5 integration combines research flexibility and trade execution into a single workflow. Python is used for data analysis, feature selection and model training, while MetaTrader 5 is used for testing and trading automation. This approach simplifies the transfer of solutions into practice, increases reproducibility, and makes the development of trading systems faster and more structured.

MetaTrader 5 features direct integration with Python, and this significantly expands the possibilities of practical work with market data. A researcher or developer can use familiar Python toolkit to study price data, build statistical models, and test practical hypotheses without breaking the connection to the trading platform. This approach makes the workflow more flexible and supports a unified cycle: from data to hypothesis, from hypothesis to model, and from model to practical application.

MetaTrader 5 + Python

In this article, we will show:

  • how Python is integrated with MetaTrader 5;
  • how to use it to analyze financial data and test hypotheses;
  • how to build and train a small model and then transfer the trained result to an EA using ONNX.

This will allow us to move from a research experiment to practical implementation in a trading system.


Author: MetaQuotes

 

In the script file load_data.py, which is in the archive, there are such lines:

#  Get bars from EURUSD H1 (hourly timeframe) within the specified interval
rates = mt5.copy_rates_range("EURUSD_i", mt5.TIMEFRAME_H1, utc_from, utc_to)

then as in the article itself:

#  Get bars from EURUSD H1 (hourly timeframe) within the specified interval
rates = mt5.copy_rates_range("EURUSD", mt5.TIMEFRAME_H1, utc_from, utc_to)

A small thing, but I did not immediately see it when testing.....

Then I had to give up python version 3.14.3. I work with python in VS. Debugging can be done there only in 3.11.
 
We appreciate this resource