MQL5 Trading Tools (Part 24): Depth-Perception Upgrades with 3D Curves, Pan Mode, and ViewCube Navigation
MQL5 Trading Tools (Part 24): Depth-Perception Upgrades with 3D Curves, Pan Mode, and ViewCube Navigation
In this article, we enhance the 3D binomial distribution graphing tool in MQL5 by adding a segmented 3D curve for improved depth perception of the probability mass function, integrating pan mode for view target shifting, and implementing an interactive view cube with hover zones and animations for quick orientation changes. We incorporate clickable sub-zones on the view cube for faces, edges, and corners to animate camera transitions to standard views, while maintaining switchable 2D/3D modes, real-time updates, and customizable parameters for immersive probabilistic analysis in trading.
The MQL5 Standard Library Explorer (Part 10): Polynomial Regression Channel
The MQL5 Standard Library Explorer (Part 10): Polynomial Regression Channel
Today, we explore another component of ALGLIB, leveraging its mathematical capabilities to develop a Polynomial Regression Channel indicator. By the end of this discussion, you will gain practical insights into indicator development using the MQL5 Standard Library, along with a fully functional, mathematically driven indicator source code.
Neuro-Structural Trading Engine — NSTE (Part I): How to Build a Prop-Firm-Safe Multi-Account System
Neuro-Structural Trading Engine — NSTE (Part I): How to Build a Prop-Firm-Safe Multi-Account System
This article lays the system architecture for a multi‑account algorithmic trading setup that operates cryptocurrency CFDs on MetaTrader 5 while respecting prop‑firm constraints. It defines three core principles—fixed dollar risk, one script per account, and centralized configuration—then details the Python–MQL5 split, the 60‑second processing loop, and JSON-based signaling. Readers get practical lot‑size computation, safety checks, and position management patterns for reliable deployment.
MQL5 Trading Tools (Part 25): Expanding to Multiple Distributions with Interactive Switching
MQL5 Trading Tools (Part 25): Expanding to Multiple Distributions with Interactive Switching
In this article, we expand the MQL5 graphing tool to support seventeen statistical distributions with interactive cycling via a header switch icon. We add type-specific data loading, discrete and continuous histogram computation, and theoretical density functions for each model, with dynamic titles, axis labels, and parameter panels that adapt automatically. The result lets you overlay distribution models on the same sample and compare fit across families without reloading the tool.
MetaTrader 5 Machine Learning Blueprint (Part 8): Bayesian Hyperparameter Optimization with Purged Cross-Validation and Trial Pruning
MetaTrader 5 Machine Learning Blueprint (Part 8): Bayesian Hyperparameter Optimization with Purged Cross-Validation and Trial Pruning
GridSearchCV and RandomizedSearchCV share a fundamental limitation in financial ML: each trial is independent, so search quality does not improve with additional compute. This article integrates Optuna — using the Tree-structured Parzen Estimator — with PurgedKFold cross-validation, HyperbandPruner early stopping, and a dual-weight convention that separates training weights from evaluation weights. The result is a five-component system: an objective function with fold-level pruning, a suggestion layer that optimizes the weighting scheme jointly with model hyperparameters, a financially-calibrated pruner, a resumable SQLite-backed orchestrator, and a converter to scikit-learn cv_results_ format. The article also establishes the boundary — drawn from Timothy Masters — between statistical objectives where directed search is beneficial and financial objectives where it is harmful.
Automating Trading Strategies in MQL5 (Part 40): Fibonacci Retracement Trading with Custom Levels
Automating Trading Strategies in MQL5 (Part 40): Fibonacci Retracement Trading with Custom Levels
In this article, we build an MQL5 Expert Advisor for Fibonacci retracement trading, using either daily candle ranges or lookback arrays to calculate custom levels like 50% and 61.8% for entries, determining bullish or bearish setups based on close vs. open. The system triggers buys or sells on price crossings of levels with max trades per level, optional closure on new Fib calcs, points-based trailing stops after a min profit threshold, and SL/TP buffers as percentages of the range.
From Novice to Expert: Forex Market Periods
From Novice to Expert: Forex Market Periods
Every market period has a beginning and an end, each closing with a price that defines its sentiment—much like any candlestick session. Understanding these reference points allows us to gauge the prevailing market mood, revealing whether bullish or bearish forces are in control. In this discussion, we take an important step forward by developing a new feature within the Market Periods Synchronizer—one that visualizes Forex market sessions to support more informed trading decisions. This tool can be especially powerful for identifying, in real time, which side—bulls or bears—dominates the session. Let’s explore this concept and uncover the insights it offers.
Developing Trading Strategy: Pseudo Pearson Correlation Approach
Developing Trading Strategy: Pseudo Pearson Correlation Approach
Generating new indicators from existing ones offers a powerful way to enhance trading analysis. By defining a mathematical function that integrates the outputs of existing indicators, traders can create hybrid indicators that consolidate multiple signals into a single, efficient tool. This article introduces a new indicator built from three oscillators using a modified version of the Pearson correlation function, which we call the Pseudo Pearson Correlation (PPC). The PPC indicator aims to quantify the dynamic relationship between oscillators and apply it within a practical trading strategy.
Developing a Trading Strategy: The Triple Sine Mean Reversion Method
Developing a Trading Strategy: The Triple Sine Mean Reversion Method
This article introduces the Triple Sine Mean Reversion Method, a trading strategy built upon a new mathematical indicator — the Triple Sine Oscillator (TSO). The TSO is derived from the sine cube function, which oscillates between –1 and +1, making it suitable for identifying overbought and oversold market conditions. Overall, the study demonstrates how mathematical functions can be transformed into practical trading tools.
Overcoming The Limitation of Machine Learning (Part 9): Correlation-Based Feature Learning in Self-Supervised Finance
Overcoming The Limitation of Machine Learning (Part 9): Correlation-Based Feature Learning in Self-Supervised Finance
Self-supervised learning is a powerful paradigm of statistical learning that searches for supervisory signals generated from the observations themselves. This approach reframes challenging unsupervised learning problems into more familiar supervised ones. This technology has overlooked applications for our objective as a community of algorithmic traders. Our discussion, therefore, aims to give the reader an approachable bridge into the open research area of self-supervised learning and offers practical applications that provide robust and reliable statistical models of financial markets without overfitting to small datasets.
Creating Custom Indicators in MQL5 (Part 9): Order Flow Footprint Chart with Price Level Volume Tracking
Creating Custom Indicators in MQL5 (Part 9): Order Flow Footprint Chart with Price Level Volume Tracking
This article builds an order-flow footprint indicator in MQL5 that aggregates tick-by-tick volume into quantized price levels and supports Bid vs Ask and Delta display modes. A canvas overlay renders color-scaled volume text aligned with the candles and updates on every tick. You will learn sorting of price levels, max-value normalization for color mapping, and responsive redraws on zoom, scroll, and resize to read volume distribution and aggressor dominance inside each bar.
Building a Research-Grounded Grid EA in MQL5: Why Most Grid EAs Fail and What Taranto Proved
Building a Research-Grounded Grid EA in MQL5: Why Most Grid EAs Fail and What Taranto Proved
This article implements a regime-adaptive grid trading EA based on the PhD research of Aldo Taranto. It presents a regime‑adaptive grid trading EA that constrains risk through restartable cycles and equity‑based safeguards. We explain why naive grids fail (variance growth and almost‑sure ruin), derive the loss formula for real‑time exposure, and implement regime‑aware gating, ATR‑dynamic spacing, and a live kill switch. Readers get the mathematical tools and production patterns needed to build, test, and operate a constrained grid safely.
Introduction to MQL5 (Part 43): Beginner Guide to File Handling in MQL5 (V)
Introduction to MQL5 (Part 43): Beginner Guide to File Handling in MQL5 (V)
The article explains how to use MQL5 structures with binary files to persist Expert Advisor parameters. It covers defining structures, accessing members, and distinguishing simple from complex layouts, then writing and reading entire records using FileWriteStruct and FileReadStruct in FILE BIN mode. You will learn safe patterns for fixed-size data and how shared storage (FILE COMMON) enables reuse across sessions and terminals.
MetaTrader 5 Machine Learning Blueprint (Part 9): Integrating Bayesian HPO into the Production Pipeline
MetaTrader 5 Machine Learning Blueprint (Part 9): Integrating Bayesian HPO into the Production Pipeline
​This article integrates the Optuna hyperparameter optimization (HPO) backend into a unified ModelDevelopmentPipeline. It adds joint tuning of model hyperparameters and sample-weight schemes, early pruning with Hyperband, and crash-resistant SQLite study storage. The pipeline auto-detects primary vs. secondary models, prepends a fitted column-dropping preprocessor for safe inference, supports sequential bootstrapping, generates an Optuna report, and includes bid/ask and LearnedStrategy links. Readers get faster, resumable runs and deployable, self-contained models.
Creating Custom Indicators in MQL5 (Part 10): Enhancing the Footprint Chart with Per-Bar Volume Sentiment Information Box
Creating Custom Indicators in MQL5 (Part 10): Enhancing the Footprint Chart with Per-Bar Volume Sentiment Information Box
The article enhances an MQL5 footprint indicator with a compact box above each candle that summarizes net delta, total volume, and buy/sell percentages. We implement supersampled anti‑aliased rendering, rounded corners via arc and quadrilateral rasterization, and per‑pixel alpha compositing. Supporting utilities include ARGB conversion, scanline fills, and box‑filter downsampling. The box delivers fast sentiment reads that stay legible across zoom levels.
Neural Networks in Trading: Adaptive Detection of Market Anomalies (DADA)
Neural Networks in Trading: Adaptive Detection of Market Anomalies (DADA)
We invite you to get acquainted with the DADA framework, which is an innovative method for detecting anomalies in time series. It helps distinguish random fluctuations from suspicious deviations. Unlike traditional methods, DADA is flexible and adapts to different data. Instead of a fixed compression level, it uses several options and chooses the most appropriate one for each case.
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.
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.
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.
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.