MetaTrader 5 Python User Group - the summary - page 37

 

Python-MetaTrader 5 Strategy Tester (Part 04): Tester 101

Python-MetaTrader 5 Strategy Tester (Part 04): Tester 101

In previous articles of this series, we laid the groundwork for building a MetaTrader 5–like strategy tester from scratch. With the core structure in place, several critical components are still missing in our project.

To this stage, we are yet to process ticks and bars sequentially, we lack mechanisms for monitoring open orders and the simulated trading account, and we do not have performance metrics such as profit and loss, drawdown, win rate, risk–reward ratios, and detailed trade statistics in the simulator.

Python-MetaTrader 5 Strategy Tester (Part 04): Tester 101
Python-MetaTrader 5 Strategy Tester (Part 04): Tester 101
  • 2026.01.23
  • www.mql5.com
In this fascinating article, we build our very first trading robot in the simulator and run a strategy testing action that resembles how the MetaTrader 5 strategy tester works, then compare the outcome produced in a custom simulation against our favorite terminal.
 

Python-MetaTrader 5 Strategy Tester (Part 05): Multi-Symbols and Timeframes Strategy Tester

Python-MetaTrader 5 Strategy Tester (Part 05): Multi-Symbols and Timeframes Strategy Tester

In the previous article, we were able to utilize real ticks, generated ticks, and bars obtained from the MetaTrader 5 terminal in our custom strategy tester. Despite ending up with a first successful strategy tester action, we are yet to fully handle and process data across various instruments and timeframes (something the MetaTrader 5  strategy tester does really well).
Python-MetaTrader 5 Strategy Tester (Part 05): Multi-Symbols and Timeframes Strategy Tester
Python-MetaTrader 5 Strategy Tester (Part 05): Multi-Symbols and Timeframes Strategy Tester
  • 2026.02.10
  • www.mql5.com
This article presents a MetaTrader 5–compatible backtesting workflow that scales across symbols and timeframes. We use HistoryManager to parallelize data collection, synchronize bars and ticks from all timeframes, and run symbol‑isolated OnTick handlers in threads. You will learn how modelling modes affect speed/accuracy, when to rely on terminal data, how to reduce I/O with event‑driven updates, and how to assemble a complete multicurrency trading robot.
 

Quantitative Analysis of Trends: Collecting Statistics in Python

Quantitative Analysis of Trends: Collecting Statistics in Python

Quantitative trend analysis is an approach that transforms chaotic market movements into an orderly system of numbers and patterns. In a world where most traders rely on intuition and visual assessment of charts, mathematical analysis of trend movements provides an undeniable advantage. Instead of subjective feelings, you receive precise data: the average trend duration in days, its typical value in points, and characteristic patterns of development and completion.

It is this objectivity that makes quantitative analysis the cornerstone of professional trading. William Eckhardt, a famous trader, rightly noted that trading is not a field of psychology, but a field of statistics. When you know that uptrends on the EURUSD pair statistically last longer than downtrends, or that 70% of trends on GBPUSD end before reaching 200 points, this is not just information, but a specific guide to action.

Quantitative Analysis of Trends: Collecting Statistics in Python
Quantitative Analysis of Trends: Collecting Statistics in Python
  • 2026.02.16
  • www.mql5.com
What is quantitative trend analysis in the Forex market? We collect statistics on trends, their magnitude and distribution across the EURUSD currency pair. How quantitative trend analysis can help you create a profitable trading expert advisor.
 

CFTC Data Mining in Python and Building an AI Model

CFTC Data Mining in Python and Building an AI Model

The proposed approach combines COT/TFF data and market quotes into a single Python model with automated trading via MetaTrader 5. This allows us to move from analysis to action without delays and human intervention.

CFTC Data Mining in Python and Building an AI Model
CFTC Data Mining in Python and Building an AI Model
  • 2026.05.04
  • www.mql5.com
Let's try mining CFTC data, downloading COT and TFF reports via Python, connecting all this with MetaTrader 5 quotes and an AI model, and get forecasts. What are COT reports in the Forex market? How to use COT and TFF reports for forecasting?
 

Python + MetaTrader 5: Fast Research Framework for Data, Features, and Prototypes

Python + MetaTrader 5: Fast Research Framework for Data, Features, and Prototypes

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.

Python + MetaTrader 5: Fast Research Framework for Data, Features, and Prototypes
Python + MetaTrader 5: Fast Research Framework for Data, Features, and Prototypes
  • 2026.05.04
  • www.mql5.com
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.
 

Beyond the Clock (Part 1): Building Activity and Imbalance Bars in Python and MQL5

Beyond the Clock (Part 1): Building Activity and Imbalance Bars in Python and MQL5

Four production problems in the pipeline are addressed explicitly: loading multi-year tick data without exceeding memory (partitioned Parquet storage read via Dask), cleaning broker-feed artifacts that corrupt bar construction (zero spreads, duplicate timestamps, NaT indices), calibrating the adaptive threshold for imbalance bars automatically so the first bar does not bias the EWM history, and persisting the EWM tracker across EA restarts so the threshold does not reset mid-session. A short parity test at the end verifies that the two implementations, fed the same tick stream, produce identical bars.
Beyond the Clock (Part 1): Building Activity and Imbalance Bars in Python and MQL5
Beyond the Clock (Part 1): Building Activity and Imbalance Bars in Python and MQL5
  • 2026.05.08
  • www.mql5.com
The article replaces clock-based sampling with López de Prado's alternative bar types and provides two aligned implementations: a unified Python module for batch tick histories and an object‑oriented MQL5 library for live EAs. It covers Parquet/Dask infrastructure, data cleaning, and a single API. Practical issues are solved explicitly: zero‑tick time‑bar filtering, imbalance threshold initialization, EWM state persistence, and parity between Python and MQL5 outputs.
 

Downloading International Monetary Fund Data Using Python

Downloading International Monetary Fund Data Using Python

Over the decades of its existence, the IMF has accumulated a unique database covering economic indicators of 190 countries. This data includes not only traditional metrics like GDP and inflation, but also complex structural indicators that allow us to see the real state of economies long before markets begin to react. The problem is that this data is presented in raw form and requires significant processing to become of practical value.
Downloading International Monetary Fund Data Using Python
Downloading International Monetary Fund Data Using Python
  • 2026.05.18
  • www.mql5.com
Downloading international monetary fund data in Python: Mining IMF data for use in macroeconomic currency strategies. How can macroeconomics help an ordinary and an algorithmic trader?
 

Detecting and Classifying Fractal Patterns Using Machine Learning

Detecting and Classifying Fractal Patterns Using Machine Learning

This article presents an original approach to identifying and classifying fractal patterns. The analysis will be conducted in Python, with the ability to export final models to the MetaTrader 5 terminal in ONNX format.

Detecting and Classifying Fractal Patterns Using Machine Learning
Detecting and Classifying Fractal Patterns Using Machine Learning
  • 2026.05.29
  • www.mql5.com
In this article, we will touch upon the intriguing topic of fractal analysis and market forecasting using machine learning. These are just the first steps towards exploring the diverse fractal structures that form on financial price charts. We will use the correlation to find patterns and the CatBoost algorithm to classify these patterns.
 

Feature Engineering for ML (Part 5): Microstructural Features in Python

Feature Engineering for ML (Part 5): Microstructural Features in Python

The preceding articles in this series treated time as a feature in its own right: fractional differentiation preserves memory across a stationary series, and cyclical encoding embeds the Fourier structure of the trading calendar into the feature matrix. Both operate on bar-level data. Microstructural features work differently. They treat each bar not as a single observation but as a compressed summary of many individual trades, and they ask what those trades reveal about the market's internal state at the moment the bar closed.
Feature Engineering for ML (Part 5): Microstructural Features in Python
Feature Engineering for ML (Part 5): Microstructural Features in Python
  • 2026.06.10
  • www.mql5.com
This article implements the Chapter 19 microstructure suite in afml.features.microstructure and explains a two-layer design for OHLCV-only and tick-augmented workflows. We cover Roll and Corwin–Schultz spread/volatility, Kyle's, Amihud's, and Hasbrouck's lambdas, VPIN, and bar‑level imbalance features, all in Numba‑accelerated kernels. A single np.searchsorted pass resolves bar boundaries, enabling prange parallelization and producing a bar‑indexed feature matrix ready for downstream ML models.
 

Why MetaTrader 5 Is the Ideal Platform for AI Trading: MQL5 + Python + ONNX + AI Assistant in a Unified Algorithmic Trading Ecosystem

Why MetaTrader 5 Is the Ideal Platform for AI Trading: MQL5 + Python + ONNX + AI Assistant in a Unified Algorithmic Trading Ecosystem

In this article, AI is not considered as a magical Make Money button, but as a layer that enhances analysis, helps formalize trading ideas, and integrates into verifiable algorithmic logic. The main goal is to show MetaTrader 5 as an infrastructure where AI progresses from a hypothesis into a controllable trading robot.
Why MetaTrader 5 Is the Ideal Platform for AI Trading: MQL5 + Python + ONNX + AI Assistant in a Unified Algorithmic Trading Ecosystem
Why MetaTrader 5 Is the Ideal Platform for AI Trading: MQL5 + Python + ONNX + AI Assistant in a Unified Algorithmic Trading Ecosystem
  • 2026.06.22
  • www.mql5.com
MetaTrader 5 is well suited for AI trading because it combines market data, MQL5 development, Python research, ONNX models, Strategy Tester, VPS, and the MQL5.community ecosystem into a single workflow. This article demonstrates a practical path from AI prompts to structured signals, working with code via the AI Assistant in MetaEditor, a quality model, a custom-created Expert Advisor, testing, and a controllable launch of a trading system.