Developing Smart Chart Objects in MQL5 (Part 1): Building a Stateful Trendline Management Framework
This article details a practical framework for converting MetaTrader 5 trendlines from static drawings into managed runtime entities. It covers object discovery, event-driven synchronization of user edits, and confirmation logic based on ATR multipliers and closed candles. A central manager coordinates multiple lines and updates their visual state. Readers can implement consistent, extensible rules for detecting proximity, validating bounces, and confirming breakouts.
Building a Hidden Risk of Ruin Auditor in MQL5
Aggregate metrics alone do not reveal how a trade sequence manages risk. This MQL5 tool analyzes closed positions to flag four structural patterns: post-loss volume escalation, overlapping same-direction entries, asymmetric payoffs, and a classical risk-of-ruin figure. The results are merged into a configurable A-F grade with concise recommendations to guide further review.
Institutional-Grade Multi-Currency Portfolio Engine in MQL5 (Part 1): Architecture of a Multi-Currency EA Framework
The article details a master–agent MQL5 framework that mitigates cross-symbol risk concentration. A single Portfolio Controller publishes risk limits and halt flags to Instrument Agents through shared channels and a readiness flag, while agents size orders only within the published budget. It contrasts global variables, named pipes, and files, and clarifies timer intervals and latency so data allocation may be up to one cycle stale without breaking coordination.
Beyond the Mean and Standard Deviation: A Robust Statistics Library for MQL5 Indicators
Price outliers distort indicators based on the mean and standard deviation. This article delivers a robust MQL5 library (RobustStats.mqh) implementing the median, 1.4826-scaled MAD, and Theil–Sen slope, plus three drop‑in indicators that replace Bollinger Bands, the linear regression channel, and the z‑score oscillator. A comparison overlay and a breakdown‑point measurement on EURUSD show how the robust instruments hold their shape when a single spike moves the classical ones.
Python + LLM API + MetaTrader 5: Real-World Experience Building an Autonomous Trading Bot
The article describes the development of an MVP prototype for an autonomous trading bot for MetaTrader 5 that uses large language models (LLMs) via the OpenRouter API to analyze the market and make trading decisions. A Python script retrieves historical OHLCV data, sends it to an LLM for technical analysis based on support/resistance levels and Price Action patterns, and then automatically places orders with specified stop loss and take profit levels.
Neural Networks in Trading: Probabilistic Time Series Forecasting (Encoder)
We invite you to explore a new approach that combines classical methods and modern neural networks for time series analysis. The article provides a detailed explanation of the architecture and operating principles of the K²VAE model.
Fast Integration of a Large Language Model with MetaTrader 5 (Part II): Fine-Tuning on Real Data, Backtesting, and Live Trading by the Model
The article describes the process of fine-tuning a language model for trading based on real historical data from MetaTrader 5. The base model, which has only theoretical knowledge of technical analysis, is trained on a thousand examples of the real behavior of currency pairs (EURUSD, GBPUSD, USDCHF, USDCAD) over 180 days. After being trained using Ollama, the model begins to understand the specific characteristics of each instrument.
MQL5 Bootstrap (III): Simplified Functions for Working with News
This article presents a unified news model and a set of reusable MQL5 classes for working with the MetaTrader 5 Economic Calendar. You will retrieve, filter, and cache events by time, currency, country, and importance using a single interface across three providers: built-in calendar, CSV, and SQLite. The framework supports export/import, next/previous event lookup, and reliable strategy‑tester backtesting without changing trading logic.
Self Optimizing Expert Advisors in MQL5 (Part 18): Time Lagged Independent Components Analysis
We evaluate blind source separation for market noise control using FastICA applied to SMA-filtered, time-lagged OHLC features. The study compares classical and surrogate targets, measures accuracy across lags, tunes KNN models, and inspects residual structure with clustering. Models are exported to ONNX and integrated into an MQL5 Expert Advisor for testing. The result is a reproducible pipeline from data extraction to deployment.
Differential Search Algorithm (DSA)
The article discusses the Differential Search Algorithm (DSA), which simulates the migration of a superorganism in search of optimal living conditions. The algorithm uses a Gamma distribution to generate a pseudo-stable random walk and offers four strategies for selecting the direction of movement, along with three coordinate mutation mechanisms. How will this method perform?
Neural Networks in Trading: Probabilistic Time Series Forecasting (K2VAE)
We invite you to explore the original implementation of the K²VAE framework — a flexible model capable of linearly approximating complex dynamics in latent space. This article demonstrates how to implement key components in MQL5, including parameterized matrices and how to manage them outside standard neural network layers. This material will be useful for anyone looking for a practical approach to building interpretable time-series models.
Training Neural Networks on Oscillators Without Look-Ahead Bias
The article describes an approach to trade labeling using oscillators for machine learning models. This eliminates look-ahead bias. It has been shown that this type of labeling does not lead to model overfitting, and the strategies continue to perform well over the long term.
Building a Basket Order Manager in MQL5 for Correlated Position Groups
The article's system introduces CBasketManager: positions are grouped by a comment‑based basket ID, analyzed as a single snapshot, and controlled with a unified equity stop. CBasketScanner computes aggregate P&L and volume‑weighted pip performance; CBasketStopRegistry triggers coordinated closure on threshold breach; CBasketExecutor adapts to the broker's filling mode. A lightweight dashboard shows live legs, volumes, stops, and distances for faster basket decisions.
Foundation Models for Trading (Part II): Decoding, Autoregression, and an Exact KV-Cache
We complete the native MQL5 port of Kronos: the decoder, the predictor's decode_s1 and decode_s2 stages with their cross-attention traps, and the autoregressive loop that produces a multi-bar forecast. Then we profile and make it roughly 4.5x faster with an exact KV-cache and pre-transposed weights, verifying every stage against PyTorch.
Making Custom Indicators for Beginners (Part 1): SuperTrend Indicator
This article builds a robust SuperTrend indicator in MQL5 using ATR-based bands, a ratchet mechanism, and strict series indexing to avoid silent recursion errors and repainting on closed bars. We walk through buffer binding, ATR handle management, seeding, and arrow confirmation logic. A companion EA demonstrates practical integration
Developing a Terminal Manager (Part 3): Getting Account Information and Adding Configuration
We are adding to our web application the ability to retrieve and display information about the terminal instances’ trading accounts, including balance, profit, connection status, and other important details. We will also implement a flexible configuration system that lets you manage application settings via an external JSON file, and improve the user interface of the main page.
Feature Engineering for ML (Part 13): Trend-Scanning Features in Python
Trend-scanning supports both forward and backward windows, and the labeling default is unsafe for features: it looks ahead and boosts next-bar agreement well above chance on random walks. We provide a dedicated wrapper, get trend scanning features, that forces computational causal and returns only window, slope, t value, and rsquared. A second analysis quantifies errors introduced by the default log transform on signed series.
Neural Networks in Trading: Adaptive Periodic Segmentation (Conclusion)
We invite you to dive into the exciting world of LightGTS — a lightweight yet powerful framework for time-series forecasting, where adaptive convolution and RoPE encoding are combined with innovative attention mechanisms. In our article, you will find a detailed description of all components — from creating patches to the complex mixture of experts in the decoder — ready for integration into MQL5 projects. Discover how LightGTS takes automated trading to a whole new level!
Bonobo Optimizer (BO)
The article presents the implementation and analysis of the Bonobo Optimizer algorithm, which is based on the unique behavioral characteristics of bonobos — their dynamic fission-fusion social structure and three mating strategies. What interesting features does this method have?
Low-Frequency Quantitative Strategies in MetaTrader 5 (Part 5): Pre-Backtest Evaluation of Machine-Learning-Generated Signals Through Formulaic Alphas
The article shows how to evaluate machine-learning alphas before a full backtest by expressing them as formulaic alphas. We compute Information Coefficient (IC), Rank IC, Information Ratio (ICIR), and t-statistics to quantify forecasting strength and stability. A MetaTrader 5 backtest illustrates differences versus execution-dependent tests, and a Python parser facilitates reproducible calculations and bulk screening.
Building a Crosshair Volume Profile Indicator in MQL5
We implement an interactive Crosshair Volume Profile indicator in MQL5 for MetaTrader 5. Using a right-click-and-drag crosshair, you select a chart region; the indicator then builds adaptive price bins, accumulates tick or real volume, detects the POC, and renders the profile on the chart. You will practice OnChartEvent()-driven interaction, cursor-to-time/price mapping, and price-source models (Close, Median, Typical, Weighted, OHLC4) for on-demand volume analysis.
Building a Dynamic ATR-Based Trend Channel Indicator in MQL5
This article develops a dynamic ATR-based trend channel indicator in MQL5 that responds to current market volatility. It derives True Range, applies a two-step ATR smoothing, and constructs adaptive upper and lower boundaries to track trend shifts. The tool also renders a trailing trend line, trend-colored candles, and reversal arrows, offering a usable code base for volatility-aware analysis and further indicator design.
Enhancing the MQL5 Portfolio Analyzer Dashboard: Active Mitigation, Data Exports, and AI Integration
This article delivers active drawdown monitoring, automated mitigation rules, Excel XML data export, and AI-assisted review for the Portfolio Analyzer dashboard. It visualizes strategy-level drawdowns over time, enforces limits by closing positions and optionally disabling AutoTrading, and generates structured spreadsheets from trade records. A hybrid MQL5-Python approach runs the external review script directly from the terminal, supporting practical risk control and transparent reporting.
CSV Data Analysis (Part 8): Building an SQLite Strategy Registry from Accumulated CSV Exports
Flat files work well at the start of an MQL5 research pipeline, but they hinder cross-run queries and provenance once the archive grows. We build a Python-based SQLite registry that ingests CSV exports with SHA-1 deduplication, records EA version and run timestamps, applies forward-only schema migrations, and indexes common filters. You get a structured query layer for fast lookups, robustness checks, and version comparisons across all campaigns.
Market Heat Map Indicator Based on Prime-Number Density
An innovative indicator based on prime number theory helps identify strong reversal levels that other traders overlook. Testing on 10 assets showed that reversals in mathematically significant zones occur 1.5 to 1.8 times more frequently. Five practical application scenarios with specific rules for filtering out false breakouts and making precise market entries.
Neural Networks in Trading: Adaptive Periodic Segmentation (Creating Tokens)
We invite you to embark on an exciting journey through the world of adaptive analysis of financial time series and learn how to turn complex spectral analysis and flexible convolution into real trading signals. You will see how LightGTS listens to the market rhythm, adapting to its changes through a variable-window stride, and how OpenCL acceleration can turn computation into a fast track to profitable decisions.
Trading Options Without Options (Part 4): More Complex Option Strategies
In this article, we will examine how to reduce risk (and whether it is even possible to do so) in option strategies where risk is initially unlimited. This applies to strategies based on writing options, i.e., range-bound strategies. We will also consider ways to lock in profits for option strategies based on purchasing options, i.e., trend-following strategies. As always, we will add new useful features to our Expert Advisor (EA) and improve the existing ones.
Learnable Curves, Not Weights: A Kolmogorov-Arnold Network from Scratch
This article builds a Kolmogorov–Arnold Network (KAN) in MQL5, where every edge carries a learnable B‑spline curve rather than a scalar weight. We construct the spline basis, assemble edges and a layer, and fit all coefficients by ridge‑regularized least‑squares in a single solve. The model is delivered as an indicator that visualizes the learned curves and an Expert Advisor that acts on the prediction, providing an interpretable, reusable codebase.
Bloch's Relative Moving Average (RMA) Framework Implementation In MQL5
We port Daniel Bloch's Relative Moving Average framework into a complete MetaTrader 5 system. Instead of smoothing price, the RMA measures where price sits inside its own recent distribution on a [0,1] fractile scale, and drives four cross-strategies with a regime-adaptive exit. Includes the engine, indicators, and a backtested Expert Advisor.
Trends and Traditions: Using Rademacher Functions in Trading
Although the functions we will discuss have been known for quite some time, their application in the field of trading remains terra incognita to this day. In this article, we will explore some of the opportunities these old-but-new functions offer for developing trading strategies and assess their potential.
Neural Networks in Trading: Adaptive Periodic Segmentation (LightGTS)
We invite you to learn about the innovative technique of adaptive patching — a method for flexibly segmenting time series while taking their internal periodicity into account. We will also look at an efficient encoding technique that preserves important semantic characteristics when working with data at different scales. These methods open up new possibilities for the accurate processing of complex, multiscale data characteristic of financial markets and significantly improve the stability and reliability of forecasts.
A Trailing Stop Engine in MQL5 Supporting Five Trail Methods Simultaneously
We implement CTrailingEngine, an interface-driven MQL5 engine that evaluates each registered position on every tick and applies one of five trailing methods: fixed-pip, ATR multiplier, Parabolic SAR, percentage-of-profit, or swing high/low. All methods share the ITrailMethod contract, so new trails plug in without engine edits. Strict improvement and a one-point guard block backward moves and no-change SLTP modifications.
Building Volatility Models in MQL5 (Part V): Implementing EGARCH as an Alternate Asymmetric Volatility Process
EGARCH models log-variance, avoiding the non-negativity constraints that can distort GARCH estimates and enabling a clear treatment of leverage asymmetry. The article provides a complete MQL5 implementation with logarithmic backcasting, simulation-based multi-step forecasting, and diagnostics including the Engle–Ng Sign Bias, Leverage Correlation, and Volatility Runs tests. Practical outputs include EGARCH Volatility, an Innovation Z-Score, and an Asymmetric Volatility Regime Oscillator to support regime analysis and strategy design.
Elite Crystal Evolution Algorithm (CEO-inspired): Practical Implementation
Experimental evaluation on standard benchmark functions reveals the advantages and limitations of directly adapting combinatorial algorithms. The article provides a detailed description of the ECEA algorithm's mechanisms and test results.
Feature Engineering for ML (Part 12): Fractal Features in MQL5
A direct MQL5 port of the fractal detector writes each pattern at its center bar, so a buffer read by an expert advisor holds a value that only existed n bars later. We implement CFractalFeatures.mqh with ProcessBar for bar-by-bar use and Compute for full-series recalculation, covering detection, strength scored against a fixed or volatility-scaled floor, an event-based support/resistance ring, and trend-filtered breakout signals. Output is eighteen buffers published at the confirmation bar, verified against the Python reference to within 1e-13.
Price Action Analysis Toolkit Development (Part 78): Extending the Indicator Search Panel with Symbol Selection in MQL5
We continue enhancing our modular indicator search panel by adding symbol selection capabilities. The implementation allows users to search for built-in indicators, choose a destination symbol, and attach the selected indicator without opening multiple charts or running separate Expert Advisor instances.
Measuring What Matters (Part 3): The Reconstruction Engine — Validating Risk Footprints with Matrix Algebra
This article performs a numerical verification of MQL5 eigendecomposition for a covariance matrix using the spectral theorem A = V Λ Vᵀ. It reconstructs the matrix with Diag(), Transpose(), and MatMul(), computes the residual and its Frobenius norm, and shows that deviations remain at floating‑point precision, with results printed to the Experts journal.
Detecting Structural Breakpoints in Price Series Using CUSUM in MQL5 (Part 2): Implementing the Detector as a Native MQL5 Indicator
This article benchmarks CUSUM_Breakpoint.mq5 against the Siegmund ARL₀ prediction on live‑like data. The empirical false‑alarm rate is about five times higher than theory for all tested symbols and timeframes, and confirmations show sensitivity to variance changes over mean changes. Practitioners should calibrate h and k on the target instrument's history and apply the signal to manage volatility regimes, not to infer directional shifts.
Neural Networks in Trading: An Intelligent Forecast Pipeline (Conclusion)
The article provides a fascinating look at how SwiGLU embedding reveals hidden market patterns, and how a sparse Mixture of Experts within a Decoder-Only Transformer makes forecasts more accurate at reasonable computational cost. We take an in-depth look at the integration of Time‑MoE into MQL5 and OpenCL, and provide a step-by-step guide to configuring and training the model.
Automating Terminal Startup for Service Tasks
The article explores the possibility of launching a terminal with a configuration file to perform automated routine tasks, programmatically handling such launches, and creating a fully-fledged system for auto-optimizing an EA using Windows OS tools.