From Novice to Expert: Adaptive Risk Management for Liquidity Strategies
From Novice to Expert: Adaptive Risk Management for Liquidity Strategies
In this article, we explore practical and robust risk management techniques specifically tailored for liquidity-based trading. You will learn how to protect positions during retests, handle false breakouts with confidence, and identify signs of potential level manipulation. By the end, you will have built an adaptive Expert Advisor capable of managing zone flips and executing strategic pending orders with integrated risk control.
Price Action Analysis Toolkit Development (Part 65): Building an MQL5 System to Monitor and Analyze Manually Drawn Fibonacci Levels
Price Action Analysis Toolkit Development (Part 65): Building an MQL5 System to Monitor and Analyze Manually Drawn Fibonacci Levels
The Fibonacci retracement tool is an essential component of price action analysis, providing critical levels for potential market reactions. However, its effectiveness is often limited by the need for continuous human monitoring, which can lead to missed setups. In this part of our series, we introduce a tool that synchronizes and actively monitors manually drawn Fibonacci levels using MQL5, combining discretionary insight with automated oversight.
Neuro-Structural Trading Engine — NSTE (Part II): Jardine's Gate Six-Gate Quantum Filter
Neuro-Structural Trading Engine — NSTE (Part II): Jardine's Gate Six-Gate Quantum Filter
This article introduces Jardine's Gate, a six-gate orthogonal signal filter for MetaTrader 5 that validates LSTM predictions across entropy, expert interference, confidence, regime-adjusted probability, trend direction, and consecutive-loss kill switch dimensions. Out of 43,200 raw signals per month, only 127 pass all six gates. Readers get the complete QuantumEdgeFilter MQL5 class, threshold calibration logic, and gate performance analytics.
Trend Criteria. Conclusion
Trend Criteria. Conclusion
In this article, we will consider the specifics of applying some trend criteria in practice. We will also try to develop several new criteria. The focus will be on the efficiency of applying these criteria to market data analysis and trading.
MQL5 Trading Tools (Part 26): Integrating Frequency Binning, Entropy, and Chi-Square in Visual Analyzer
MQL5 Trading Tools (Part 26): Integrating Frequency Binning, Entropy, and Chi-Square in Visual Analyzer
In this article, we develop a frequency analysis tool in MQL5 that bins price data into histograms, computes entropy for information content, and applies chi-square tests for distribution goodness-of-fit, with interactive logs and statistical panels for market insights. We integrate per-bar or per-tick computation modes, supersampled rendering for smooth visuals, and draggable/resizable canvases with auto-scrolling logs to enhance usability in trading analysis.
Pair Trading: Algorithmic Trading with Auto Optimization Based on Z-Score Differences
Pair Trading: Algorithmic Trading with Auto Optimization Based on Z-Score Differences
In this article, we will explore what pair trading is and how correlation trading works. We will also create an EA for automating pair trading and add the ability to automatically optimize this trading algorithm based on historical data. In addition, as part of the project, we will learn how to calculate the differences between two pairs using the z-score.
MetaTrader 5 Machine Learning Blueprint (Part 10): Bet Sizing for Financial Machine Learning
MetaTrader 5 Machine Learning Blueprint (Part 10): Bet Sizing for Financial Machine Learning
Fixed fractions and raw probabilities misallocate risk under overlapping labels and induce overtrading. This article delivers four AFML-compliant sizers: probability-based (z-score → CDF, active-bet averaging, discretization), forecast-price (sigmoid/power with w calibration and limit price), budget-constrained (direction-only), and reserve (mixture-CDF via EF3M). You get a signed, bounded position series with documented conditions of use.
Swing Extremes and Pullbacks in MQL5 (Part 3): Defining Structural Validity Beyond Simple Highs/Lows
Swing Extremes and Pullbacks in MQL5 (Part 3): Defining Structural Validity Beyond Simple Highs/Lows
This article presents an MQL5 Expert Advisor that upgrades raw swing detection to a rule-based Structural Validation Engine. Swings are confirmed by a break of structure, displacement, liquidity sweeps, or time-based respect, then linked to a liquidity map and a structural state machine. The result is context-aware entries and stops anchored to validated levels, helping filter noise and systematize execution.
Low-Frequency Quantitative Strategies in Metatrader 5: (Part 2) Backtesting a Lead/Lag Analysis in SQL and in Metatrader 5
Low-Frequency Quantitative Strategies in Metatrader 5: (Part 2) Backtesting a Lead/Lag Analysis in SQL and in Metatrader 5
The article describes a complete pipeline that uses data analysis for finding low-frequency lead/lag trading opportunities. It goes into building a cross-correlation-based Lead/Lag analyser step-by-step, with special attention to the most common errors beginners may commit while developing cross-asset diffusion queries. After screening dozens of cointegrated and correlated pairs, a trading candidate pair is chosen, and its tradeability is evaluated in a pure SQL backtest. Once it is qualified, the strategy is backtested on the MetaTester for parameter optimization. The Expert Advisor with respective backtest settings and optimization inputs is provided, along with Python and SQL scripts.
Building a Correlation-Aware Multi-EA Portfolio Scorer in MQL5
Building a Correlation-Aware Multi-EA Portfolio Scorer in MQL5
Most algo traders optimize Expert Advisors individually but never measure how they behave together on a single account. Correlated strategies amplify drawdowns instead of reducing them, and coverage gaps leave portfolios blind during entire trading sessions. This article builds a complete portfolio scorer in MQL5 that reads daily P&L from backtest CSV files, computes a full Pearson correlation matrix, maps trading activity by hour and weekday, evaluates asset class diversity, and outputs a composite grade from A+ to F. All source code is included; no external libraries are required.
One-Dimensional Singular Spectrum Analysis
One-Dimensional Singular Spectrum Analysis
The article examines the theoretical and practical aspects of the singular spectrum analysis (SSA) method, which is an efficient method of time series analysis that allows one to represent the complex structure of a series as a decomposition into simple components, such as trend, seasonal (periodic) fluctuations and noise.
MetaTrader 5 Machine Learning Blueprint (Part 11): Kelly Criterion, Prop Firm Integration, and CPCV Dynamic Backtesting
MetaTrader 5 Machine Learning Blueprint (Part 11): Kelly Criterion, Prop Firm Integration, and CPCV Dynamic Backtesting
The bet-sizing signal from Part 10 is concurrency-corrected but carries no payoff-ratio adjustment, no response to a hard drawdown budget, and no validation across combinatorial paths. This article covers three additions: a two-stage architecture in which a Kelly payoff multiplier is applied on top of get_signal, preserving the concurrency correction while incorporating win/loss asymmetry; a prop firm integration layer that calibrates the sigmoid w parameter continuously from the remaining drawdown budget under FundedNext Stellar 2-Step rules; and a CPCV backtest framework that simulates a fresh account state across all φ[N, k] paths, producing a Sharpe distribution and a PBO audit.
Predicting Renko Bars with CatBoost AI
Predicting Renko Bars with CatBoost AI
How to use Renko bars with AI? Let's look at Renko trading on Forex with forecast accuracy of up to 59.27%. We will explore the benefits of Renko bars for filtering market noise, learn why volume is more important than price patterns, and how to set the optimal Renko block size for EURUSD. This is a step-by-step guide on integrating CatBoost, Python, and MetaTrader 5 to create your own Renko Forex forecasting system. It is ideal for traders looking to go beyond traditional technical analysis.
Creating Custom Indicators in MQL5 (Part 11): Enhancing the Footprint Chart with Market Structure and Order Flow Layers
Creating Custom Indicators in MQL5 (Part 11): Enhancing the Footprint Chart with Market Structure and Order Flow Layers
This article extends the MQL5 footprint chart with market-structure and order-flow layers: volume-profile bars, point of control, value-area highlighting, stacked imbalance detection, absorption zones, and single-print/unfinished markers. We expand bar data structures, add functions for POC/value area, imbalance, and absorption, and build a fixed-order rendering pipeline. You will get ready-to-use inputs, metadata, and drawing utilities to integrate and customize these layers in your indicator.
Building a Volume Bubble Indicator in MQL5 Using Standard Deviation
Building a Volume Bubble Indicator in MQL5 Using Standard Deviation
The article demonstrates how to build a Volume Bubble Indicator in MQL5 that visualizes market activity using statistical normalization. It covers how to work with tick and real volume, compute the mean and standard deviation over a rolling window, and normalize volume values to identify relative strength. You will implement chart objects to display bubbles with dynamic size and color, providing a clear representation of volume intensity directly on the chart.
From Simple Close Buttons to a Rule-Based Risk Dashboard in MQL5
From Simple Close Buttons to a Rule-Based Risk Dashboard in MQL5
Build a rule-based on-chart risk management panel in MetaTrader 5 using the MQL5 Standard Library. The guide covers a CAppDialog-based GUI, manual event routing, and an automated update loop. You will bind UI events to CTrade to execute conditional closures, show net floating P/L, and read automated targets directly from the chart.
Can DOOM Run in MetaTrader 5: DLLs, Rendering, and MQL5 Input?
Can DOOM Run in MetaTrader 5: DLLs, Rendering, and MQL5 Input?
This article demonstrates how to run DOOM inside MetaTrader 5 by integrating a native Windows DLL with an MQL5 Expert Advisor. We cover building the DLL, real-time framebuffer rendering via ResourceCreate, keyboard input with a key-up workaround using GetAsyncKeyState, and running the game loop on a background thread. The techniques are directly applicable to custom visualization, external data bridges, and robust MQL5–native code integration.
Chaos optimization algorithm (COA)
Chaos optimization algorithm (COA)
This is an improved chaotic optimization algorithm (COA) that combines the effects of chaos with adaptive search mechanisms. The algorithm uses a set of chaotic maps and inertial components to explore the search space. The article reveals the theoretical foundations of chaotic methods of financial optimization.
Chaos optimization algorithm (COA): Continued
Chaos optimization algorithm (COA): Continued
We continue studying the chaotic optimization algorithm. The second part of the article deals with the practical aspects of the algorithm implementation, its testing and conclusions.
Formulating Dynamic Multi-Pair EA (Part 8): Time-of-Day Capital Rotation Approach
Formulating Dynamic Multi-Pair EA (Part 8): Time-of-Day Capital Rotation Approach
This article presents a Time-of-Day capital rotation engine for MQL5 that allocates risk by trading session instead of using uniform exposure. We detail session budgets within a daily risk cap, dynamic lot sizing from remaining session risk, and automatic daily resets. Execution uses session-specific breakout and fade logic with ATR-based volatility confirmation. Readers gain a practical template to deploy capital where session conditions are statistically strongest while keeping exposure controlled throughout the day.
Feature Engineering for ML (Part 1): Fractional Differentiation — Stationarity Without Memory Loss
Feature Engineering for ML (Part 1): Fractional Differentiation — Stationarity Without Memory Loss
Integer differentiation forces a binary choice between stationarity and memory: returns (d=1) are stationary but discard all price-level information; raw prices (d=0) preserve memory but violate ML stationarity assumptions. We implement the fixed-width fractional differentiation (FFD) method from AFML Chapter 5, covering get_weights_ffd (iterative recurrence with threshold cutoff), frac_diff_ffd (bounded dot product per bar), and fracdiff_optimal (binary search for minimum stationary d*).
MetaTrader 5 Machine Learning Blueprint (Part 12): Probability Calibration for Financial Machine Learning
MetaTrader 5 Machine Learning Blueprint (Part 12): Probability Calibration for Financial Machine Learning
Tree-based classifiers are typically overconfident: true win rates near 0.55 appear as 0.65–0.80 and inflate position sizes and Kelly fractions. This article presents afml.calibration and CalibratorCV, which generate out-of-fold predictions via PurgedKFold and fit isotonic regression or Platt scaling. We define Brier score, ECE, and MCE, and show diagnostics that trace miscalibration into position sizes, realized P&L, and CPCV path Sharpe distributions to support leakage-free, correctly sized trading.
GoertzelBrain: Adaptive Spectral Cycle Detection with Neural Network Ensemble in MQL5
GoertzelBrain: Adaptive Spectral Cycle Detection with Neural Network Ensemble in MQL5
GoertzelBrain combines Goertzel spectral analysis with an online‑trained neural network ensemble to convert cycle features into a directional confirmation signal. The indicator builds a compact feature vector from the dominant period, amplitude, confidence and their dynamics, plus local volatility, and outputs +1, −1 or 0. The article provides the full MQL5 implementation, explains the architecture and feature engineering, and shows how to use it as a directional filter.
Fractal-Based Algorithm (FBA)
Fractal-Based Algorithm (FBA)
The article presents a new metaheuristic method based on a fractal approach to partitioning the search space for solving optimization problems. The algorithm sequentially identifies and separates promising areas, creating a self-similar fractal structure that concentrates computing resources on the most promising areas. A unique mutation mechanism aimed at better solutions ensures an optimal balance between exploration and exploitation of the search space, significantly increasing the efficiency of the algorithm.
MQL5 Wizard Techniques You should know (Part 86): Speeding Up Data Access with a Sparse Table for a Custom Trailing Class
MQL5 Wizard Techniques You should know (Part 86): Speeding Up Data Access with a Sparse Table for a Custom Trailing Class
We revamp our earlier articles on testing trade setups with the MQL5 Wizard by putting a bit more emphasis on input data quality, cleaning, and handling. In the earlier articles we had looked at a lot of custom signal classes, usable by the wizard, so we now shift our focus to a custom trailing class, given that exiting is also a very important part in any trading system. Our broad theme for this particular piece data-efficiency and the O(1) range-query; the core ‘tech’ is MQL5, SQLite, Python-Polars; the Algorithm is the Sparse-Table while we will seek validation from the ATR Indicator.
Overcoming Accessibility Problems in MQL5 Trading Tools (Part III): Bidirectional Speech Communication Between a Trader and an Expert Advisor
Overcoming Accessibility Problems in MQL5 Trading Tools (Part III): Bidirectional Speech Communication Between a Trader and an Expert Advisor
Build a local, bidirectional voice interface for MetaTrader 5 using MQL5 WebRequest and two Python services. The article implements offline speech recognition with Vosk, wake‑word detection, an HTTP command endpoint, and a text‑to‑speech server on localhost. You will wire an Expert Advisor that fetches commands, executes trades, and returns spoken confirmations for hands‑free operation.
Applying L1 Trend Filtering in MetaTrader 5
Applying L1 Trend Filtering in MetaTrader 5
This article explores the practical application of L1 trend filtering in MetaTrader 5, covering both its mathematical foundations and usage in MQL5 programs. The L1 filter enables extraction of piecewise-linear trends that preserve essential market structure while reducing price noise. The study analyzes parameter scaling, trend estimation behavior, and integration of the method into algorithmic trading strategies. Experimental results demonstrate how L1 trend filtering can enhance signal stability, trade timing, and overall robustness of trading systems.
Foundation Models in Trading: Time Series Forecasting with Google's TimesFM 2.5 in MetaTrader 5
Foundation Models in Trading: Time Series Forecasting with Google's TimesFM 2.5 in MetaTrader 5
Time series forecasting in trading has evolved from traditional statistical models (like ARIMA) to deep learning approaches, but both require heavy tuning and training. Inspired by advances in NLP, Google’s TimesFM introduces a pretrained “foundation model” for time series that can perform strong forecasts even without task-specific training. For traders, this is powerful because it can be efficiently fine-tuned on their own data using lightweight methods like LoRA, reducing overfitting while adapting to changing market conditions.
MQL5 Trading Tools (Part 27): Rendering Parametric Butterfly Curve on Canvas
MQL5 Trading Tools (Part 27): Rendering Parametric Butterfly Curve on Canvas
In this article, we explore the butterfly curve, a parametric mathematical equation, and render it visually on a MQL5 canvas. We build an interactive display with a draggable, resizable canvas window, supersampled curve rendering, gradient backgrounds, and a color-segmented legend. By the end, we have a fully functional visual tool that plots the butterfly curve directly on the MetaTrader 5 chart.
Volumetric neural network analysis as a key to future trends
Volumetric neural network analysis as a key to future trends
The article explores the possibility of improving price forecasting based on trading volume analysis by integrating technical analysis principles with LSTM neural network architecture. Particular attention is paid to the detection and interpretation of anomalous volumes, the use of clustering and the creation of features based on volumes and their definition in the context of machine learning.
Hidden Markov Models in Machine Learning-Based Trading Systems
Hidden Markov Models in Machine Learning-Based Trading Systems
Hidden Markov Models (HMMs) are a powerful class of probabilistic models designed to analyze sequential data, where observed events depend on some sequence of unobserved (hidden) states that form a Markov process. The main assumptions of HMM include the Markov property for hidden states, meaning that the probability of transition to the next state depends only on the current state, and the independence of observations given knowledge of the current hidden state.
Account Audit System in MQL5 (Part 1): Designing the User Interface
Account Audit System in MQL5 (Part 1): Designing the User Interface
This article builds the user interface layer of an Account Audit System in MQL5 using CChartObject classes. We construct an on-chart dashboard that displays key metrics such as start/end balance, net profit, total trades, wins/losses, win rate, withdrawals, and a star-based performance rating. A menu button lets you show or hide the panel and restores one-click trading, delivering a clean, usable foundation for the broader audit pipeline.
Automating Market Entropy Indicator: Trading System Based on Information Theory
Automating Market Entropy Indicator: Trading System Based on Information Theory
This article presents an EA that automates the previously introduced Market Entropy methodology. It computes fast and slow entropy, momentum, and compression states, validates signals, and executes orders with SL/TP and optional position reversal. The result is a practical, configurable tool that applies information-theoretic signals without manual interpretation.