Articles on manual and algorithmic trading in MetaTrader 5

icon

This category features articles on all aspects of trading - from manual to fully automatic trading, from Expert Advisor ideas to trading robot creation using the MQL5 Wizard. Position management, processing of trade events and money management - these integral parts of trading are covered in theses articles.

Learn how to copy trading signals and how to provide around-the-clock operation of Expert Advisors, how to create a trading robot and how to run MetaTrader on Linux and MacOS, what social trading is and how to order a trading robot.

Add a new article
latest | best
preview
From Cloud to Complex: The Vietoris-Rips Filtration in MQL5

From Cloud to Complex: The Vietoris-Rips Filtration in MQL5

We turn a price-embedded point cloud into a Vietoris–Rips filtration and its boundary matrix. The article enumerates vertices, edges, and triangles with filtration values, sorts them in entry order, and builds O(1) vertex/edge lookups. You get MQL5 classes CTDARips and CTDABoundary and a sparse Z/2 boundary suitable for the next-step persistence reduction.
preview
Shape of Price: An Introduction to TDA and Takens Embedding in MQL5

Shape of Price: An Introduction to TDA and Takens Embedding in MQL5

The article presents a practical foundation for shape analysis of price series in MQL5. It implements Takens time‑delay embedding to build a phase‑space point cloud and computes the full pairwise distance matrix under selectable norms. The CTDAPointCloud and CTDADistance classes are provided with a demo script that embeds chart data and outputs results, preparing inputs for downstream topological tools.
preview
Overcoming Accessibility Problems in MQL5 Trading Tools (Part V): Gesture-Based Trading With Computer Vision

Overcoming Accessibility Problems in MQL5 Trading Tools (Part V): Gesture-Based Trading With Computer Vision

This article shows how to build a hands-free trading workflow for MetaTrader 5 by translating webcam-tracked hand gestures into MQL5 trade commands. We cover the architecture (MediaPipe/OpenCV in Python plus an MQL5 EA), gesture-to-action mapping, and interprocess communication via Global Variables or HTTP polling. You will implement the EA, execute BUY/SELL/CLOSE actions, and validate latency and reliability under real‑time conditions.
preview
Ordinal Pattern Transition Networks in MQL5

Ordinal Pattern Transition Networks in MQL5

We implement ordinal pattern transition networks in MQL5: a Lehmer-code encoder, a directed network over ordinal price patterns, and three complexity metrics. Two indicators expose a trend-versus-range regime from time-irreversibility and an efficiency gauge from permutation entropy, with a transparent parameter sweep showing how to tune settings on FX data.
preview
Persistent Homology in MQL5: The Reduction Algorithm and the Persistence Diagram

Persistent Homology in MQL5: The Reduction Algorithm and the Persistence Diagram

We complete persistent homology for MQL5 by reducing the Vietoris–Rips boundary matrix to a persistence diagram. The article implements Z/2 column reduction (CTDAReduction), a diagram container with analytics (CTDADiagram), and a facade that runs the six-stage pipeline in one call (CTDA). Outputs are cross-checked against Ripser to numerical agreement, enabling reliable diagram-based metrics.
preview
From Option Chain to 3D Volatility Surface in MetaTrader 5

From Option Chain to 3D Volatility Surface in MetaTrader 5

This article walks through creating an MT5 indicator that ingests option chains from native symbols or CSV, inverts prices to implied volatility via a hybrid Newton–Raphson/bisection method, and assembles a clean strike–expiry grid. It then renders a shaded, rotatable 3D surface with the platform's DirectX layer, enabling clear, in-terminal analysis of skew and term structure using live or file-based data.
preview
Building Your Personal Expert Advisor (Part 1): From Fragile Script to Working EA

Building Your Personal Expert Advisor (Part 1): From Fragile Script to Working EA

This article focuses on EA architecture rather than signal design. Starting with a flawed Moving Average crossover EA, we add new‑bar detection to prevent duplicate entries, Magic Number and position awareness, ATR‑based risk levels, and data and trade result validation, along with basic safeguards. You obtain a practical base to build and test advanced systems.
preview
Developing a Terminal Manager (Part 2): Running Multiple Terminal Instances

Developing a Terminal Manager (Part 2): Running Multiple Terminal Instances

Let's move on to using multiple terminal instances on the server by setting up a simple control panel for starting and stopping them. Now it is time to expand the functionality and move on to the next stages — implementing more complex features, such as managing multiple terminal instances, state persistence, integration with the MetaTrader 5 API, and a web interface with comprehensive information about the terminals.
preview
Developing a Terminal Manager (Part 1): Problem Statement

Developing a Terminal Manager (Part 1): Problem Statement

How can we conveniently monitor multiple terminals running Expert Advisors, especially when they are on different computers? Let's try to create a web interface for managing the launch of MetaTrader 5 trading terminals and viewing detailed information about the operation of each instance.
preview
Porting the Canonical Catch22 Time-Series Feature Set and Testing It on Volatility Regimes

Porting the Canonical Catch22 Time-Series Feature Set and Testing It on Volatility Regimes

We present a native MQL5 implementation of the catch22 feature set: all 22 canonical time-series characteristics in a reusable class validated against pycatch22. Using a leak-free pipeline (chronological split, purging, embargo), we run a three-arm ablation—classic indicators, catch22, and combined—for volatility-regime classification. Finally, we deploy the combined model as a Strategy Tester regime filter to quantify its impact on a simple baseline strategy.
preview
From One Price to Four: Range-Based Volatility Estimators for MetaTrader 5

From One Price to Four: Range-Based Volatility Estimators for MetaTrader 5

Close-to-close volatility ignores the high, the low, and overnight gaps. We build a reusable MQL5 library implementing four range-based estimators from Parkinson to the gap-robust Yang-Zhang, and put it to work in a comparison indicator and a set of adaptive volatility bands.
preview
Building a Divergence System (Part III): The Adaptive SuperTrend EA

Building a Divergence System (Part III): The Adaptive SuperTrend EA

The article implements a self-sufficient Adaptive SuperTrend EA with internal calculations on a selectable timeframe, avoiding external buffers and indicator files. It includes risk-based lot sizing, ATR stops, stepwise RR trailing, optional anti-repainting confirmation, and session control. Practitioners can reuse the structure for consistent new‑bar signal handling and broker‑compliant order validation.
preview
Automating Trading Strategies in MQL5 (Part 51): The Bread and Butter Judas Swing Model with Premium and Discount

Automating Trading Strategies in MQL5 (Part 51): The Bread and Butter Judas Swing Model with Premium and Discount

We build a session-based reversal program in MQL5 using the Bread and Butter Judas Swing model. It derives a higher-timeframe daily bias, defines New York kill zones, maps each session's premium and discount from the live range, and requires a sweep before a market structure shift confirms entry. Readers get a ready approach to arm setups only during active sessions and execute in the bias direction with clear, testable rules.
preview
Automating Trading Strategies in MQL5 (Part 51): The Bread and Butter Judas Swing Model with Premium and Discount

Automating Trading Strategies in MQL5 (Part 51): The Bread and Butter Judas Swing Model with Premium and Discount

We build a session-based reversal program in MQL5 using the Bread and Butter Judas Swing model. It derives a higher-timeframe daily bias, defines New York kill zones, maps each session's premium and discount from the live range, and requires a sweep before a market structure shift confirms entry. Readers get a ready approach to arm setups only during active sessions and execute in the bias direction with clear, testable rules.