Articles with examples of indicators developed in MQL5

icon

The articles contain detailed explanation of the attached codes. Download and open them in MetaEditor and program together with the author while reading the article.

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
Market Microstructure in MQL5 (Part 8): Micro-Trend Strength

Market Microstructure in MQL5 (Part 8): Micro-Trend Strength

Part 8 adds bar-by-bar micro-trend scoring for NQ M1. GetMicroTrendStrength() builds a continuous [-1, +1] composite from EMA alignment, ATR‑normalized price position, slope consistency, and volume, with a contradiction penalty to suppress alignment/price conflicts. Session-adaptive thresholds scale by Part 7 confidence to modulate signal frequency across regimes. Outputs include a seven-state label, a binary signal, and a persistence check, calibrated on 514 New York sessions (May 2024–May 2026).
preview
Building a Modular Fair Value Gap (FVG) Detection Engine in MQL5

Building a Modular Fair Value Gap (FVG) Detection Engine in MQL5

This article introduces a modular Fair Value Gap (FVG) detection engine for MQL5 packaged as a reusable include class, it evaluates imbalance zones on closed bars, applies a Simple True Range average filter to eliminate low-volatility noise, and supports wick-touch and close-through mitigation. A companion diagnostic indicator plots active gaps, and an Expert Advisor template demonstrates automated pullback entries with new-bar execution controls.
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
The Avellaneda-Stoikov Model: Inventory-Aware Quoting for Two-Sided Strategies

The Avellaneda-Stoikov Model: Inventory-Aware Quoting for Two-Sided Strategies

This article builds the Avellaneda–Stoikov formulas in MQL5, feeds them with rolling estimates of mid-price volatility and a proxy for order-flow intensity, and plots the reservation price with bid and ask in real time. A bar-by-bar simulation contrasts adaptive and fixed quoting under the same fill rules. The result is a tested class, an indicator, and a backtest to improve inventory control in two‑sided strategies.
preview
Implementing Anchored VWAP Indicator in MQL5: A Step-by-Step Guide

Implementing Anchored VWAP Indicator in MQL5: A Step-by-Step Guide

A step-by-step guide to building an anchored VWAP indicator with an interactive draggable anchor line in MQL5. The article covers the complete implementation, including calculation methodology, session resets, standard deviation bands, and custom visualization. Learn the architectural design decisions behind stateless boundary detection, multi-instance support, and cross-asset volume handling to build a versatile indicator with benchmarking, technical, and analytical capabilities.
preview
Building a Future Swing Projection Indicator in MQL5

Building a Future Swing Projection Indicator in MQL5

We implement a Future Swing Projection indicator in MQL5 that analyzes historical swing structure and estimates the next move from recent price behavior. It locates six alternating swing points, measures five completed legs, and uses their average distance to project a target five bars ahead. The indicator draws swing legs, a projection line, ATR‑based support and resistance zones, and a label with the projected price to keep the process rule‑based and reproducible.
preview
Machine Learning Without the Black Box: The Tsetlin Machine for Trading

Machine Learning Without the Black Box: The Tsetlin Machine for Trading

This article builds a white-box classifier in MQL5 using the Tsetlin Machine. It learns human-readable AND-rules instead of weights, trains with integer state updates, and requires no external dependencies. You will assemble the automaton, clause, and multi-class voter, verify on XOR and other boolean tasks, booleanize indicators, label by forward ATR-scaled return, save the model to CSV, and view active rules on a live chart.
preview
Path Signatures for Lead-Lag Detection

Path Signatures for Lead-Lag Detection

Build a level-2 path-signature engine in pure MQL5 to read the lead-lag ordering between two data streams without choosing a lag and without a linear model. The article delivers a reusable library, an indicator that plots the Levy‑area oscillator, and a simple rule‑based Expert Advisor. Code is cross‑checked against closed‑form cases, and the components are ready to plug into your projects.
preview
Machine Learning Without the Black Box: The Tsetlin Machine for Trading

Machine Learning Without the Black Box: The Tsetlin Machine for Trading

This article builds a white-box classifier in MQL5 using the Tsetlin Machine. It learns human-readable AND-rules instead of weights, trains with integer state updates, and requires no external dependencies. You will assemble the automaton, clause, and multi-class voter, verify on XOR and other boolean tasks, booleanize indicators, label by forward ATR-scaled return, save the model to CSV, and view active rules on a live chart.