MQL5 Programming Articles

icon

Study the MQL5 language for programming trading strategies in numerous published articles mostly written by you - the community members. The articles are grouped into categories to help you quicker find answers to any questions related to programming: Integration, Tester, Trading Strategies, etc.

Follow our new publications and discuss them on the Forum!

Add a new article
latest | best
preview
How to Detect and Normalize Chart Objects in MQL5 (Part 5): Fibonacci in Focus

How to Detect and Normalize Chart Objects in MQL5 (Part 5): Fibonacci in Focus

The article bridges automated placement with manual analysis for the Fibonacci family in MQL5. It scans charts, identifies user Fibonacci objects, and normalizes their level arrays, interaction flags, and visuals per object type while preserving coordinates. With manual-priority enforcement, Expert Advisors can evaluate both human and code-generated tools reliably, without duplicates or runtime indexing issues.
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
Interactive Supply and Demand Zone Manager in MQL5 (Part IV): Trading Supply and Demand Zones

Interactive Supply and Demand Zone Manager in MQL5 (Part IV): Trading Supply and Demand Zones

We extend the supply and demand framework with a strategy layer that converts zone interactions into decisions. Qualified zones pass sequential checks for interaction proximity, approach behavior, higher‑timeframe alignment, and price action before execution is handed to a dedicated trade manager. This architecture improves control, maintainability, and future extensibility without changing the underlying zone engine.
preview
Automating Terminal Startup for Service Tasks

Automating Terminal Startup for Service Tasks

The article explores the possibility of launching a terminal with a configuration file to perform automated routine tasks, programmatically handling such launches, and creating a fully-fledged system for auto-optimizing an EA using Windows OS tools.
preview
Neural Networks in Trading: An Intelligent Forecast Pipeline (Conclusion)

Neural Networks in Trading: An Intelligent Forecast Pipeline (Conclusion)

The article provides a fascinating look at how SwiGLU embedding reveals hidden market patterns, and how a sparse Mixture of Experts within a Decoder-Only Transformer makes forecasts more accurate at reasonable computational cost. We take an in-depth look at the integration of Time‑MoE into MQL5 and OpenCL, and provide a step-by-step guide to configuring and training the model.
preview
Measuring What Matters (Part 3): The Reconstruction Engine — Validating Risk Footprints with Matrix Algebra

Measuring What Matters (Part 3): The Reconstruction Engine — Validating Risk Footprints with Matrix Algebra

This article performs a numerical verification of MQL5 eigendecomposition for a covariance matrix using the spectral theorem A = V Λ Vᵀ. It reconstructs the matrix with Diag(), Transpose(), and MatMul(), computes the residual and its Frobenius norm, and shows that deviations remain at floating‑point precision, with results printed to the Experts journal.
preview
Price Action Analysis Toolkit Development (Part 78): Extending the Indicator Search Panel with Symbol Selection in MQL5

Price Action Analysis Toolkit Development (Part 78): Extending the Indicator Search Panel with Symbol Selection in MQL5

We continue enhancing our modular indicator search panel by adding symbol selection capabilities. The implementation allows users to search for built-in indicators, choose a destination symbol, and attach the selected indicator without opening multiple charts or running separate Expert Advisor instances.
preview
Detecting Structural Breakpoints in Price Series Using CUSUM in MQL5 (Part 2): Implementing the Detector as a Native MQL5 Indicator

Detecting Structural Breakpoints in Price Series Using CUSUM in MQL5 (Part 2): Implementing the Detector as a Native MQL5 Indicator

This article benchmarks CUSUM_Breakpoint.mq5 against the Siegmund ARL₀ prediction on live‑like data. The empirical false‑alarm rate is about five times higher than theory for all tested symbols and timeframes, and confirmations show sensitivity to variance changes over mean changes. Practitioners should calibrate h and k on the target instrument's history and apply the signal to manage volatility regimes, not to infer directional shifts.