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.
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).
In this article, triangular arbitrage is presented as a problem of finding cycles in a directed graph, where the vertices are currencies and the edges are currency pairs with weight rates. Profitable cycle: product of weights >1. Our Floyd-Warshall and DFS algorithms find optimal currency exchange paths that return to the starting point with a profit.
We describe an MQL5 framework that aligns entries with session rhythms and scheduled clock events. A script identifies the broker's time zone and DST by detecting NFP spikes on EURUSD and matching them to EU/US/AU transition dates, producing EA‑ready settings. Session-to-broker time conversion and 15-minute marks constrain execution. A multi‑timeframe AMA signal aggregates trends for strategy selection and optimization.
Despite what was shown in the previous article, all of this may seem simple at first. In reality, several problems remain, along with many tasks that still need to be completed. You, dear reader, may imagine that everything is easy and straightforward. Out of inexperience, you may simply accept whatever is presented to you. And that is a mistake you should try to avoid. Even worse is trying to use something without truly understanding what exactly you are using. Beginners often pass through a copy-and-paste stage. If you do not want to remain stuck at that stage forever, you should learn how to use certain tools. One of the tools most often used by programmers is documentation. The second is testing, supported by log files. Here we will see how to do this.
Kronos is a pretrained transformer that models OHLCV bars the way a language model predicts words. We reimplement its tokenizer/encoder and transformer block in native MQL5, export weights to flat .bin files, and remove Python from runtime entirely. Part 1 delivers preprocessing and BSQ tokenization plus a bit-for-bit verification harness against PyTorch, so you can run the encoder inside MetaTrader 5 with confidence.
A rolling-window Approximate Entropy oscillator for MQL5, built without external dependencies. Covers the full mathematics of template matching, Chebyshev distance, and the Phi-function derivation before presenting a reusable CApEnCalculator class and a color-zoned subwindow indicator. Includes a synthetic-data verification script and an honest discussion of bias, parameter sensitivity, and computational cost.
Here we will start bringing together different components or applications that were previously completely isolated from each other. Chart Trade, the mouse indicator, and the Expert Advisor had already been linked to one another, but there was still no way to directly display on the chart the positions open on the trading server, which are often managed using a cross-order system. From this point on, this becomes possible, opening the way for various ideas and future implementations. Although we are only beginning to put these components into operation, we already have a direction for further development.
The article presents a complete implementation of TimeGPT, a specialized Transformer-based architecture for forecasting financial time series on the MetaTrader 5 platform. Adaptation of the attention mechanism to financial data, selective tokenization of price changes, hardware-aware optimizations, and advanced learning techniques are discussed. Included are practical testing results showing 87% forecast accuracy over a 24-bar horizon with a training time of 15 minutes on the CPU. We also present a ready-made trading EA with automatic retraining.
This article presents a standalone Portfolio Analyzer dashboard implemented as an Expert Advisor for MetaTrader 5. It reads account deal history, reconstructs closed positions, and attributes results by magic number or normalized comment to deliver clear per-strategy metrics. The interface provides a vector equity curve, date filters, and strategy selectors, plus a Pearson correlation matrix to reveal strategy redundancy. You can attach it to a separate chart without modifying existing trading EAs.
This article builds a constant-memory EW covariance engine and a chart heatmap for monitoring cross-symbol correlations in MQL5. CEWCovariance updates in O(N²) time per bar and exposes covariance/correlation accessors; CHeatmapRenderer shows a five‑symbol matrix with values and colors. You will learn λ-to‑window mapping, how to set a meaningful min_obs warm‑up, and how to size the variance guard epsilon for real FX M1 data.
Implementation of the N-BEATS architecture for Forex trading in MetaTrader 5 with quantile forecasting and adaptive risk management. The architecture is adapted through bilinear normalization and specialized loss functions for financial data. Backtesting on 2025 data shows inability to generate profits, confirming the gap between theoretical achievements and practical trading performance.
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.
We extend the stateful supply and demand framework for MetaTrader 5 with a quantitative admission model and a dedicated interaction engine. Candidate zones are scored by structural symmetry, volume participation, and ATR‑normalized displacement, then classified into objective tiers. Admitted zones follow a deterministic lifecycle that tracks first touch, validates bounces, or confirms breakouts, with full telemetry for analysis and reproducibility.
This article turns the verified TDA pipeline into a live MQL5 indicator. It reduces each price window to two persistence-entropy lines (H0 and H1), computes a normalized loop-strength metric with an adaptive percentile band, and places fade marks only when loop strength is high and price hits a window extreme. You can attach the indicator, read six buffers from an Expert Advisor, and tune key window, ranking, and performance parameters.
This article extends single-candlestick analysis to ordered double-candlestick patterns using an MQL5 script. The script encodes candles into symbols, extracts every consecutive two-symbol sequence (treating Aa and aA as different), counts occurrences and percentages, and writes sorted frequency tables to a text file. Readers can quickly identify the most recurrent transitions by symbol, timeframe, and lookback for further statistical testing.
The article presents the revolutionary architecture of PatchTST, a tailored transformer for financial time series analysis that breaks market data into 16-bar patches for efficient processing. We will discuss the full implementation of a trading robot in MQL5 covering everything from mathematical fundamentals and data structures to a ready-made EA with risk management and continuous learning systems.
We add SQLite persistence to the canvas tools, saving every drawing and the entire UI session per symbol, then restoring them on startup so the workspace resumes exactly where you left it. The article builds versioned object serialization, a load/save lifecycle with dirty writes, and a timeframe-visibility editor that drives render-time filtering. The toolkit also runs as an indicator, so it can sit alongside other indicators or an Expert Advisor.
In Part 2, we introduce a reusable CCovarianceMatrix class that computes and stores a covariance matrix from raw return series using MQL5's native Cov() method. We verify symmetry, print a labeled matrix grid, and call Eig() to obtain eigenvalues and eigenvectors. Readers see how symbols co-move and which factors drive variance, enabling clearer portfolio diagnostics and reuse in scripts or EAs.
In previous articles, we mentioned that sometimes we need to set a value for the ZOrder property. But why? The reason is that many pieces of code that add objects to a chart simply do not use, or more precisely do not define, a value for this property. The point is that I am not here to say what every programmer should or should not do, or how they should or should not write their code. I am here to show you, dear reader, and everyone who truly wants to understand how these processes work internally, what actually happens behind the scenes.
This article finalizes the MMAR project with a CMMAR facade class and a demo Expert Advisor for MetaTrader 5. The facade exposes a compact API—configure, Fit(), Forecast()—that wraps partition analysis, spectrum fitting and Monte Carlo simulation. You will learn how to load data, fit the model and obtain a volatility forecast, with diagnostics and status handling for robust use in EAs.
In this article, I will show how to use an indicator to track open positions on the trading server in the simplest and most practical way possible. I am doing this step by step to show that you do not necessarily have to move all of this into an Expert Advisor. Many of you have probably become used to doing that for one reason or another. In fact, that is not really justified, because as this implementation evolves, it will become clear that you can create or implement different types of indicators for this purpose.
Standard MQL5 risk tools read risk from recent history and miss how heavy the downside tail can be. We implement Extreme Value Theory in MetaTrader 5: a Peaks‑Over‑Threshold fit of the Generalized Pareto Distribution via ALGLIB, a live indicator that reports EVT VaR/ES and tail shape, and an EA that sizes positions from the tail estimate. A controlled backtest illustrates reduced drawdown for unchanged entries.
The content we will cover from this point on is much more complex in terms of theory and concepts. I will try to make the material as simple as possible. The programming part itself is quite simple and straightforward. But if you do not understand the theory behind it, you will be left with no practical basis at all for refining or adapting the replay/simulation system to tasks different from the ones I am going to show. I do not want you merely to compile and use the code I present. I want you to learn, understand and, if possible, be able to create something even better.
The article builds a reusable validation layer for Expert Advisors in MQL5. It implements lot-size rules and normalization, SL/TP and freeze-level guards, price digit normalization, margin sufficiency checks, unchanged-level filtering on modifications, account order-limit control, new-bar detection, symbol tradability checks, economic-calendar news windows, and session detectors. The result is cleaner code and fewer terminal errors in live trading.
We add a pinned-tools ribbon: a floating bar that exposes frequently used tools for one-click access without reopening the sidebar. The article implements the ordered pin set and its API, an anti-aliased pushpin control in the flyout, and the ribbon with offscreen clipping, user-resizable width, and horizontal scrolling. The result is faster activation of favorite tools from a draggable, resizable ribbon on the chart.
Parameter optimization inside MetaTrader 5's Strategy Tester routinely produces strategies that perform well in-sample and collapse on forward data. This article builds a native MQL5 Walk-Forward Efficiency scoring engine that quantifies how much of a strategy's in-sample Sharpe ratio transfers to each out-of-sample window. The distribution is rendered as a CCanvas histogram and validated against real EURUSD Daily backtest data.
We implement a symbol resolution framework that abstracts broker naming differences in MetaTrader 5. Using a persistent mapping store, layered resolution with validation, a hash-indexed registry, and a cache, it returns selectable symbols with live market data and logs unresolved cases. Practically, you can deploy the same EA across brokers and keep symbol access consistent at low runtime cost.
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.
Abnormal bars inflate mean and standard deviation estimates, distorting ATR, Bollinger Bands, and moving averages. We implement a native MQL5 indicator that detects such bars with the Modified Z-Score applied to four features: body, upper wick, lower wick, and tick volume. The indicator marks flagged bars on the chart and plots a composite score in a separate subwindow, helping you diagnose contamination in rolling-window indicators.
This article presents a multi‑broker CSV normalization framework. An MQL5 include file enriches exports with broker metadata. A Python module resolves schema divergences — pip conventions, symbol aliases, time offsets, commission models, and currency denomination — producing a unified canonical dataset. Comparative visualizations of slippage distributions and net‑of‑cost performance enable reliable cross‑platform strategy analysis without silent data corruption.
We present a timer-based MQL5 EA for Opening Range Breakout aligned to NYSE hours. It screens “Stocks in Play” via opening-range relative volume, enforces price/volume/ATR minimums, sizes positions by risk, and exits at 16:00 ET. A Sharpe-ranked optimization across 30 liquid Nasdaq stocks and a single-symbol test are provided, together with backtest settings and an Excel report for verification.
The article presents an innovative hybrid system for forecasting exchange rates that combines a linear autoregressive model with a U-Transformer architecture for residual analysis. The system automatically switches between signal sources depending on their quality and includes complete trading logic with averaging/pyramiding strategies. The key advantage of this approach is that the neural network is trained on the residuals of the linear model, which simplifies the task and reduces the risk of overfitting. The implementation is done entirely in MQL5 and is ready for use in real trading with automatic adaptation to changing market conditions.
Maximum drawdown is one number that hides what really matters: how often an equity curve declines, how long it stays below a previous peak, and how quickly it recovers. This article builds a native MQL5 tool that reconstructs the underwater curve, breaks it into individual drawdown episodes (depth, duration, recovery time), computes the Ulcer Index, Pain Index, and Recovery Factor, and combines them into a single resilience grade with practical recommendations. No external libraries, no Python, no AI.
The article delivers MQL5 implementations of FIGARCH and HARCH and updates the volatility library for long‑memory processes. It provides code for Hurst and GPH testing, parameter setup (truncation and horizons), and scripts for fitting, forecasting, and simulations. Readers learn how to apply and compare the models on market data to select an appropriate specification.
A population-based optimization algorithm inspired by a controversial and little-studied phenomenon - the mechanism of human dreams. Agent groups with different "memory", cosine-wave modulation of motion, and an unusual 99/1 phase distribution — learn how these features affect the optimization efficiency of your trading strategies.
CTrailingSlidingMedianBiLSTM is a custom MQL5 Wizard trailing module that combines robust median/MAD outlier filtering with a BiLSTM context score in the range [-1, 1]. Four algorithm modes (standard, bands, RSI, adaptive) target noise, mean-reverting bursts and liquidity spikes, reducing premature stop adjustments. This module is intended for side-by-side evaluation with diverse entry signals and money management settings.
Implement a session-focused volume profile in MQL5: acquire ticks with CopyTicksRange(), bin prices, and compute POC, VAH, and VAL by the 70% approach. The indicator renders directly on the chart as native objects, supports fixed-width scaling for consistent geometry across timeframes, and refreshes on each new session. This provides objective reference levels without external dependencies.
What if your trading strategies could learn from each other, like real fighters? Duelist Algorithm is a new optimization method where trading system parameters literally duel for the right to be called the best.
A revolutionary approach to machine learning in trading through quantum computing. The article demonstrates a practical implementation of an adaptive QRC system with continuous retraining for predicting market movements in real time.