A while back, I looked for a way to backtest ideas manually to see whether they made sense and which filters could improve accuracy. This was before I knew MQL5, and I was participating in competitions that encouraged gambling rather than trading. You know them, the ones that are free to enter, change rules from time to time and the first person has tripled their account within a day…..those ones.
Great implementation! On-chart buttons for manual backtesting are so handy. Especially useful for validating ideas before optimization.
In this article, we will look at the practical application of optimization frames in MetaTrader 5, learn how to save our own metrics and analyze the results, as well as build custom stability criteria based on the entire optimization surface. The main focus will be on identifying stable areas of parameters capable of maintaining predictable behavior even after changing market conditions.
The article examines an engineering approach to optimizing an Expert Advisor in MetaTrader 5: from collecting custom metrics through Optimization Frames to parameter surface analysis. A simple event-driven EMA/RSI model demonstrates CSV export, smoothing, and local stability assessment in Python. The goal is to find stable areas of configurations and validate them with forward optimization for reliable implementation.
In this article, we will walk through how to transform optimization result arrays, cluster volumes, and scenario models into manageable 3D landscapes. We will define the criteria of appropriateness: when 3D graphics add signal analysis capabilities, and when they generate visual noise. We will then move on to the architecture of the DX pipeline, examining initialization, binding metrics to vertex buffers, camera mechanics, and UI panels, and finally assessing the technological limitations of the environment.
The article describes the practical application of DirectX 11 and built-in MQL5 tools for creating 3D visualizations and interactive interfaces in MetaTrader 5. The focus is on cognitive efficiency - the ability of 3D charts and guided scenes to help in understanding optimization data, liquidity clusters, and multi-dimensional trading scenarios. The basics of the DX pipeline, working with shaders, binding mouse and keyboard events, and objective technological limitations are discussed in detail. The article is intended for MQL5 developers and algorithmic traders who are ready to transform strategy metrics into understandable 3D analytical landscapes, where the visual layer accelerates decision-making.
Every backtest result inherits the quality of its input data, yet few people check that data before computing statistics. Traders routinely see MetaTrader 5's built‑in “History Quality” drop from 99% to 30% without knowing why. Others discover too late that their feed had silent gaps in the exact period they tested. The forums are full of the same question — "how do I verify my history is complete across several pairs?" — and the usual answer is "write a script yourself."
This article is that script. It builds a reproducible, read‑only data audit that you run once before trusting any backtest. Then it shows why the audit matters by running the same trivial strategy on data from three brokers and measuring the result drift. The brokers are anonymized throughout (Broker A, B, C) — the point is not who is "best," but that "the same backtest" is an illusion the moment the data underneath it changes.
Everything here is reproducible. Full Python source is attached; it imports only read-only functions (API calls) from the MetaTrader 5 package and never touches an order function.
A reproducible, read-only Python audit for MetaTrader 5 that verifies history quality before any backtest. It exports M5 data from multiple terminals, detects gaps and synthetic bars by timestamp spacing, and reports coverage per year. The same deterministic strategy then runs on three broker feeds over a common window to quantify result drift and decompose it into spread, data/price, and trade effects.
If you code in MQL5, you have probably lived this: the Strategy Tester draws a beautiful, almost straight equity curve, and when you put the same Expert Advisor (EA) on a real account, the result is very different. I have hit that wall more than once. My first instinct used to be to blame the strategy — but very often the strategy is fine. What changed is the execution quality.
...
In this article I build a diagnostic tool—not a strategy—that captures execution metrics on your account. It helps answer one question with numbers: "Is my live result falling short because of the strategy, or because of execution?" The tool is an EA called Execution Quality Monitor.
This tool does not measure the broker in isolation. It measures the entire execution path (terminal/PC/VPS, network, broker gateway, venue liquidity), so poor results can come from any link. There is a dedicated section on this later; keep it in mind throughout.
Live performance often drifts from backtests because of execution friction. We introduce an MQL5 diagnostic EA that records entry and exit slippage, asymmetry, observed spread, requotes, and per-leg latency, using a precise probe mode and an approximate passive mode, and writes every sample to CSV. Use the results to distinguish strategy issues from execution effects across your terminal, network, broker, and liquidity.
I would like to suggest adding two or three time periods to the Strategy Tester's settings tab, with checkboxes for the timeframes; This would make it possible to quickly validate a test using a timeframe different from the one used for optimization. Thank´s!
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Manual Backtesting with On-Chart Buttons in the MetaTrader 5 Strategy Tester
From "Best Pass" to Robust Solutions: Exploring the Optimization Surface in MetaTrader 5
3D Visualization Without External Libraries: How MetaTrader 5 Reveals Optimization Results via MQL5 + DX11
Trust Your Backtest Data First: Building a Reproducible Historical Data Audit in Python for MetaTrader 5
Every backtest result inherits the quality of its input data, yet few people check that data before computing statistics. Traders routinely see MetaTrader 5's built‑in “History Quality” drop from 99% to 30% without knowing why. Others discover too late that their feed had silent gaps in the exact period they tested. The forums are full of the same question — "how do I verify my history is complete across several pairs?" — and the usual answer is "write a script yourself."
This article is that script. It builds a reproducible, read‑only data audit that you run once before trusting any backtest. Then it shows why the audit matters by running the same trivial strategy on data from three brokers and measuring the result drift. The brokers are anonymized throughout (Broker A, B, C) — the point is not who is "best," but that "the same backtest" is an illusion the moment the data underneath it changes.Everything here is reproducible. Full Python source is attached; it imports only read-only functions (API calls) from the MetaTrader 5 package and never touches an order function.
Measuring broker execution quality in MQL5: Why your live account doesn't match the backtest
If you code in MQL5, you have probably lived this: the Strategy Tester draws a beautiful, almost straight equity curve, and when you put the same Expert Advisor (EA) on a real account, the result is very different. I have hit that wall more than once. My first instinct used to be to blame the strategy — but very often the strategy is fine. What changed is the execution quality.
...
In this article I build a diagnostic tool—not a strategy—that captures execution metrics on your account. It helps answer one question with numbers: "Is my live result falling short because of the strategy, or because of execution?" The tool is an EA called Execution Quality Monitor.
This tool does not measure the broker in isolation. It measures the entire execution path (terminal/PC/VPS, network, broker gateway, venue liquidity), so poor results can come from any link. There is a dedicated section on this later; keep it in mind throughout.
I would like to suggest adding two or three time periods to the Strategy Tester's settings tab, with checkboxes for the timeframes; This would make it possible to quickly validate a test using a timeframe different from the one used for optimization. Thank´s!