Forecast Reconciliation (MinT): One Engine for Timeframe Hierarchies and Currency Graphs
This article builds forecast reconciliation in pure MQL5 and applies it to two structures: timeframe aggregation on one symbol and a currency graph linked by no‑arbitrage. The engine projects base forecasts onto linear constraints to make them coherent. We benchmark OLS/WLS and MinT with and without shrinkage on long walk‑forward runs, show when total squared error decreases, and measure the cost that may concentrate in a single node.
Surrogate Data Testing: A Null Model for Any Statistic, and Why Shuffling Bars Is Not One
We implement surrogate testing for indicators in MQL5: generate synthetic series that match your data's distribution and spectrum, score any statistic, and locate the observation within its null distribution. The library provides four null models, an FFT that handles arbitrary lengths, and a plug‑in interface for custom measures. An indicator visualizes the statistical alongside its chance band for direct interpretation.
Evolutionary Selection of LLM Agents in MetaTrader 5
The article describes the architecture of a trading system consisting of 20 Grok (xAI)-based LLM agents, each of which embodies a unique trading philosophy — from pure momentum to a statistical z-score. The system applies a genetic algorithm directly during trading: every 20 trades, it automatically eliminates weak agents, clones strong ones with a prompt mutation, and publishes a leaderboard on the MetaTrader 5 chart — without interrupting trading and without using any SDK.
Price Action Analysis Toolkit Development (Part 85): Visualizing and Reviewing Validated Double-Bottom Samples
This part adds a visual review layer to the double-bottom workflow. It checks the chart context, moves to the recorded period, and renders the range, two qualifying lows, neckline, classification, score, and the first decisive close. The annotations mirror the validator's indices and prices, helping you audit outcomes without changing sample data.
Institutional-Grade Multi-Currency Portfolio Engine in MQL5 (Part 2): Instrument Universe Management and Symbol Metadata
This article adds a symbol metadata layer to the MQL5 portfolio framework, normalizing contract specifications across instruments with different tick sizes and profit currencies. A CSymbolRegistry class loads a symbol universe from file, queries broker data, and converts tick values into account currency, including cross-rate and CFD tick/point cases. The Portfolio Controller publishes per-symbol lot limits from this metadata, and Instrument Agents recover automatically once the controller becomes available.
Does Your EA Depend on Candle Boundaries? A Shifted-Bar Stress Test in MQL5
The framework evaluates boundary sensitivity by rebuilding shifted target-timeframe bars from completed M1 sources and running one Strategy Tester pass for each boundary offset. It includes a ShiftedBarBuilder, a demonstration EA, and a deterministic self-test. An XAUUSD M15 case study reports net profit, Profit Factor, maximum relative equity drawdown, and total trades across all 15 offsets to quantify dependence on the bar grid.
Feature Neutralization in MQL5: Orthogonalizing Trading Signals Against Confound Factors
We implement feature neutralization so your signal is evaluated without volatility/trend confounds. The core is a native MQL5 rolling OLS engine using Gauss-Jordan elimination and out-of-sample residual scoring, with no DLLs. An EA and indicator integrate the residual and log diagnostics, while a Python companion validates numerics and runs bar-replay tests. Use it to isolate linear exposure and assess true signal contribution.
Neural Networks in Trading: Training Deep Spiking Models (Spike Integration)
The article presents a practical implementation of the key components of the SEW-ResNet framework using MQL5. The use of dynamic arrays and spiking mechanisms enables flexible model architecture design and efficient processing of financial time series. The proposed solutions demonstrate how SEW-ResNet can optimize computations and improve the extraction of meaningful features.
Harris Hawks Optimization (HHO)
We implement the Harris Hawks Optimization algorithm in MQL5 and analyze five movement modes of agents controlled by a single parameter — the decaying escape energy E. The C_AO_HHO class is introduced; it is compatible with the unified test bench and features a reproducible implementation of Lévy flight. The algorithm was tested on the Hilly, Forest, and Megacity functions with 5, 25, and 500 coordinates — the results indicate anomalous behavior.
Ollivier-Ricci Curvature: Reading the Shape of a Correlation Network, Not Its Level
The article builds an Ollivier–Ricci curvature library in MQL5 for multi‑symbol analysis. A basket becomes a correlation network, and the reading captures network geometry rather than correlation level. It includes an exact optimal transport solver with an internal certificate, a rolling fragility metric with two informative nulls, an indicator that plots the reading against its null band, and a demonstration expert that uses it as a risk gate.
Price Action Analysis Toolkit Development (Part 84): Validating Recorded Double-Bottom Samples
This work adds an explainable validation module to the recording toolkit for double bottoms. It finds and filters swing lows, selects the neckline, quantifies depth, low similarity, symmetry and recovery, and assigns a rule-based status and scores accepted pairs. The settings are configurable, the process is reproducible, and the original sample data remains intact for comparison across rule sets.
Neural Networks in Trading: Training Deep Spiking Models (SEW-ResNet)
We invite you to explore the SEW-ResNet framework, which allows you to build deep spiking models without degradation issues and with effective gradient management. In this article, we demonstrate how to implement a basic spiking neuron and its algorithms using MQL5.
Foundation Models for Trading (Part III): Running a Generative AI Forecaster Inside MetaTrader 5
We demonstrate live forecast charting with Kronos in MQL5 and an evaluation pipeline designed to be look‑ahead‑safe. Deterministic dumps are scored per horizon against a random‑walk baseline (15,113 predictions), then fed to a simple Strategy Tester rule on EURUSD H1. The findings show no edge, and illustrate how a high threshold can yield a persuasive but low‑information backtest with very few trades.
Machine Learning Under Constraint (Part 3): De-Risking Near the Profit Target and the News-Window Rule
Position sizing that ignores proximity to a profit target or the timing of high-impact news exposes banked progress to reversal risk and misstates simulated profit near funded-stage news releases. We implement derisking_factor, a piecewise-linear size reduction keyed to phase progress with a floor set by minimum-trading-days status, and news_window_factor, a phase-gated step function applying FundedNext's news reward-share haircut in a configurable window around correlated events. Both return bounded multipliers combined multiplicatively with the sizer's other modifiers.
How to Test and Customize Built-in MQL5 Programs: Envelopes with Alligator Strategy
Envelopes define percentage boundaries around a moving average, but a boundary touch alone does not identify whether the market is trending or ranging. We build Envelope_Alligator_Strategy.mq5, a custom indicator that reads the built-in Envelopes and Alligator buffers. Ordered Alligator lines classify directional states; interwoven lines identify a neutral state. This context changes how envelope crossings are interpreted and produces testable, non-trading chart signals.
Price Action Analysis Toolkit Development (Part 83): Building a Reusable Double-Bottom Pattern Library
This recorder bridges visual labeling and systematic research in MQL5. After you position a rectangle, the EA extracts the candles it spans, derives candle geometry, normalizes OHLC values, assigns an ID, and saves the sample for reuse across sessions. The current category is the double bottom, and the module records the chosen sequence without enforcing a predefined pattern definition.
Certified Robustness Radius: Knowing How Much Noise Your ONNX Trading Model Can Survive
We introduce a certified-radius gate for ONNX signals implemented natively in MQL5. The system estimates per-prediction robustness via randomized smoothing and a one-sided Clopper–Pearson bound, then applies the radius to trade admission, lot scaling, and monitoring. This provides an actionable confidence margin that reflects input noise tolerance rather than softmax magnitude.
Neural Networks in Trading: From Transformers to Spiking Neurons (Conclusion)
Neural networks are already changing the way we analyze markets, and new architectures are opening up even more possibilities. In this article, we wrap up our work with the SpikingBrain framework, which opens up new possibilities for us.
MiniRocket: A Deterministic Time-Series Classifier and What It Finds in Seven Classic Setups
This article delivers a native MQL5 MiniRocket: 84 fixed convolution kernels yield 9,996 features quickly and deterministically, requiring no training loop and no external runtime. We verify the port against sktime and a float64 reimplementation, then run a reproducible audit of seven classic setups; planted and coin‑flip controls confirm correctness, and a 25%‑flipped control sets the detection threshold.
The Maximal Information Coefficient: Detecting Any Relationship, and the Null That Decides Whether It Is Real
This article implements the Maximal Information Coefficient (MINE) for MQL5, including the grid search with dynamic programming and the four MINE statistics. It explains why raw MIC has a nonzero noise floor and builds a permutation null to judge significance. The result is a verified library with a dependence scanner and a chart indicator, allowing you to test features and interpret scores consistently across relationship shapes.
Symbol Correlation Monitor with Live Heatmap in MQL5
This work delivers an MQL5 Expert Advisor that reads open-position symbols, builds return series, and computes a rolling Pearson correlation matrix, displayed as a CCanvas heatmap. Off-diagonal pairs that meet a warning threshold are bordered for quick scanning. The code details return processing, correlation arithmetic, and matrix indexing, with a verification script, helping you track shifting co-movements across your active book.
Price Action Analysis Toolkit Development (Part 82): Annotating Historical Bookmarks with Reliable Timeframe Switching
We implement visible bookmark annotations and a hand-off mechanism for cross-symbol and cross-timeframe recall. The navigator stores the target in terminal Global Variables, waits for stable bars after reinitialization, and rebuilds only matching markers with safe cleanup. Traders can inspect saved events in context and navigate back to them without reconstructing chart settings.
Practical Modules from Other Languages in MQL5 (Part 08): MATPLOTLIB
Learn how to bring advanced plotting and data visualization to the MetaTrader 5 terminal by leveraging Matplotlib, one of Python's most powerful and widely used visualization libraries.
Strategy Optimization and Forward Analysis (Part 1): The Pardo Method — A Basic Model
The article explains how to establish a reproducible process for developing and testing trading systems in MetaTrader 5: from formalizing entry and exit rules and risk management to post-optimization validation. It is based on the "Pardo Method": splitting historical data into in-sample and out-of-sample periods, forward testing, multiple markets/timeframes, and selecting stable parameter "plateaus" instead of isolated peaks. Using the examples of PardoSystem and the PardoEA / Breakout_Bounce Expert Advisors (EAs), this article demonstrates a practical test plan for the MetaTrader 5 Strategy Tester.
Master the Z-Score: Building Mean-Reverting MQL5 Trading Systems
This article explains how to use the Z-Score to quantify price deviations in standard deviations and apply the concept in MQL5. We cover the calculation, interpretation across market regimes, and the implementation of a custom indicator and three trading strategies as Expert Advisors. Readers get complete code examples and a testing workflow, plus practical notes on lookback selection, fat tails, execution timing, and risk controls.
Larry Williams Market Secrets (Part 18): Automating the Greatest Swing Value Breakout Strategy in MQL5
This article converts the Greatest Swing Value breakout rules into a configurable MQL5 Expert Advisor. It implements measurable setup conditions, failure-swing calculations, one-bar setup validity, and M1 breakout confirmation. The EA also supports broker-compatible risk management, manual or percentage-risk sizing, position control, and trade-server validation, providing a reproducible framework for independent Strategy Tester research across different markets and historical periods.
MetaTrader 5 Machine Learning Blueprint (Part 22): Auditing the Selection Criterion — Measuring Overfit in Hyperparameter Search
We show that nested cross-validation removes optimistic evaluation bias but does not stop hyperparameter search from overfitting a finite sample, and we add a diagnostic for when the criterion cannot resolve candidates from noise. We implement OffsetPurgedKFold (boundary-shifted repartitioning), a criterion variance audit (resolution ratio and selection stability), a selection optimization curve, a corrected one-standard-error rule, noise-floor early stopping, and an effective trial count for correlated trials. The result is a dispersion report per candidate and an effective count for the Deflated Sharpe Ratio.
Trade Entry Timing Accuracy Analyzer in MQL5
This article builds an MQL5 dashboard that evaluates entry timing for closed positions using tick‑based Maximum Adverse Excursion (MAE) and Maximum Favorable Excursion (MFE). It computes an entry efficiency ratio, renders an MAE/MFE scatter plot and an efficiency histogram, and prints a concise summary to the Experts tab. Deal grouping, tick‑level excursion logic, and a standalone verification script are included so you can diagnose entry quality across many trades.
Building AI-Powered Trading Systems in MQL5 (Part 12): Giving the Assistant Chart Vision and Tool Access
We give our AI chat assistant two new abilities in MQL5: sight and tool access. It can now capture the chart as a screenshot, attach it to a message, and view it in the panel, and it can call tools that read live positions, trade history, indicator values, chart objects, and the economic calendar. The assistant reasons from what it sees and queries rather than text alone.
Neural Networks in Trading: From Transformers to Spiking Neurons (Key Components)
We present to the reader an implementation of the SpikingBrain framework’s approaches based on recurrent linear attention with gates, discussed in detail in this article. Forward pass, gradient propagation, and weight update algorithms ensure efficient processing of financial time series and enable the practical implementation of the framework’s key concepts.
Encoding Candlestick Pattern (Part 6): Developing the Encoded Sequence Indicator
An on-chart MQL5 indicator generates a live stream of encoded candlestick symbols and a frequency report for the last N bars. It supports color customization and type filtering, and uses A/a, H/h, E/e, G/g, D, and N/n classifications. Traders can quickly review occurrences and common sequences directly on the chart.
Regime Discovery by Structure: Implementing Toeplitz Inverse Covariance Clustering (TICC)
This article presents a full MQL5 pipeline for Toeplitz Inverse Covariance Clustering: stacked observations, ADMM‑based graphical lasso with block‑Toeplitz constraints, and dynamic‑programming regime assignment. It separates structure from volatility and conditions away the shared USD leg. The fitted regimes are displayed causally as a non-repainting ribbon with a dependency graph for the active state.
Uncertainty as a Model (Part 3): Mathematical Statistics — How to Extract Knowledge from Data
This part of the series examines the mechanisms of the Law of Large Numbers (LLN) and the Central Limit Theorem (CLT) as the theoretical foundation for understanding market patterns. This section describes the tools of descriptive statistics and methods for finding point and interval estimates of distribution parameters. Particular attention is paid to the methodology for testing statistical hypotheses, which makes it possible to objectively distinguish genuine market anomalies from random noise. Each theoretical concept is accompanied by a practical example in the appendix, which helps reinforce the material using specific data.
Neural Networks in Trading: From Transformers to Spiking Neurons (SpikingBrain)
The SpikingBrain framework demonstrates a unique approach to data processing: neurons respond only to significant events, effectively filtering out noise. Its event-driven architecture reduces computational costs while preserving key information about price movements. Adaptive thresholds and the ability to use pre-trained modules ensure the model's flexibility and scalability.
Time Series Shapelets: Learning a Price Shape, and Testing Whether It Means Anything
We implement a Time Series Shapelet library for MQL5 that finds the subsequence of price history whose z-normalized shape best separates two labels and derives the decision threshold from information gain. Because candidate searches on prices always return a winner, the fit includes a purged hold-out and a calibrated block permutation null. You get a reusable facade and rules you can plot and evaluate against an explicit noise floor.
Inside MetaEditor's AI Assistant: Writing, Repairing and Testing MQL5 with an Agent
We use the MetaTrader 5 AI Assistant to execute the full workflow end to end: create an EA from a natural‑language prompt, compile it, break and watch it self‑correct from compiler output, backtest it, and compare a controlled re‑run. The article details the underlying MCP extensions, configuration and safety limits, and how to connect external AI clients. Readers get a repeatable process for building and testing EAs inside the platform.
Monthly Profit and Loss Calendar Heatmap Renderer in MQL5
The article presents an MQL5 script that reads closed deals, groups them by date, and renders a calendar grid for daily P&L and trade count. It explains the data model, normalization to midnight, robust week/weekday mapping, diverging and single-hue color scales, and CCanvas-based drawing, plus a verification script and weekday summary. This helps you quickly locate clusters and quiet periods and cross-check findings with logged totals.
Swarm Optimizer with Hierarchical Sub-Flocks — Flock by Leader
We are developing and implementing the Flock by Leader algorithm in MQL5: sub-flocks are formed based on the ARF metric, and the leader is determined by the highest personal best rather than by the centroid's position. We present the update formulas for the swarm roles and the separation mechanism. The C_AO_FBL class is compatible with the test bench and has been tested on the Hilly, Forest, and Megacity functions with dimensionalities from 10 to 1000 coordinates, which simplifies reproduction and comparison.
Developing Smart Chart Objects in MQL5 (Part 2): Automating Trendline Discovery and Lifecycle Management
Learn how Smart Trendline Manager separates creation from lifecycle control while handling both manual and auto-generated trendlines. It demonstrates discovery, registration, proximity and touch handling, bounce/break confirmation, post-break resurrection, expiration, and state-driven visualization. This gives you a consistent, configurable way to manage multiple lines through one orchestrated update process.
Meta-Labeling the Classics (Part 4): Filtering and Sizing MACD Trades
MACD signal-line crossovers often reflect range noise rather than true momentum shifts, producing whipsaws. We apply a two-layer meta-labeling pipeline with an Optuna-optimized regime gate to filter entries on EURUSD H1, turning a gross-losing rule into a positive but not statistically significant track. A secondary Random Forest adds no lift due to too few gated samples, clarifying when filtering helps and when the ML layer is data-starved.