Building an Object-Oriented FVG Scanner in MQL5
Building an Object-Oriented FVG Scanner in MQL5
Create an object-oriented fair value gap (FVG) scanner in MQL5 and display liquidity gaps directly on a MetaTrader 5 chart, this article formalizes the imbalance geometry based on three candlesticks, synchronizes OHLC arrays with CopyRates, manages rectangles without leaks, and monitors mitigation in real time. It also shows how to integrate this class into an Expert Advisor with a strict new bar filter for stable and efficient execution.
From Novice to Expert: Creating an MTF CRT Overlay Indicator in MQL5
From Novice to Expert: Creating an MTF CRT Overlay Indicator in MQL5
Higher-timeframe CRT ranges are informative, yet traders often execute on lower timeframes without that context. We implement an MQL5 indicator that reads higher-timeframe OHLC, projects the full candle range, body, and wicks onto the active lower-timeframe chart, and marks entries, stops, and targets. This improves situational awareness and removes the need to switch windows.
MQL5 Trading Tools (Part 30): Class-Based Tool Palette Sidebar
MQL5 Trading Tools (Part 30): Class-Based Tool Palette Sidebar
We refactor the Tools Palette from a flat, function-based panel into a modular, class-driven sidebar in MQL5. The design introduces supersampled canvas rendering for anti-aliased shapes, theme control, a category registry, snap alignment, and selective corner rounding. The result is a reusable, scalable sidebar foundation that you can extend with tool selection, dragging, and fly-out menus in future steps.
Building AI-Powered Trading Systems in MQL5 (Part 9): Creating an AI Signal Dispatcher
Building AI-Powered Trading Systems in MQL5 (Part 9): Creating an AI Signal Dispatcher
We turn the MQL5 AI trading assistant into a dispatch-driven system that routes seven trading actions through a single central dispatcher. A line-based key-value protocol constrains AI output, while each action maps to market or pending orders and instrument-aware stop levels. A canvas-based UI with a custom prompt editor and pixel-accurate text fitting makes signals consistent, auditable, and ready to render on the chart
Building an Object-Oriented ONNX Inference Engine in MQL5
Building an Object-Oriented ONNX Inference Engine in MQL5
This article shows how to run Python-trained models natively in MetaTrader 5 via the terminal's ONNX functions. We build an MQL5 class that encapsulates session creation, fixes input/output tensor shapes, applies min-max feature normalization to mirror training, and executes OnnxRun once per bar to protect the CPU, the result is a reliable, maintainable inference path for live charts and the Strategy Tester without sockets or DLLs.
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.
Leak-Free Multi-Timeframe Engine with Closed-Bar Reads in MQL5
Leak-Free Multi-Timeframe Engine with Closed-Bar Reads in MQL5
The article presents two systematic pitfalls in MQL5 multi‑timeframe work: indicator handle leaks that exhausted resources and repainting from reading the forming bar (index 0). It introduces MTFEngine.mqh, a unified include that creates and tracks handles in one place and defaults all reads to closed bars (index 1). A D1–H4–H1 example shows how this approach keeps signals technically correct and consistent with charts.
MQL5 Wizard Techniques you should know (Part 90): Fenwick Tree Money Management with 1D CNN in MQL5
MQL5 Wizard Techniques you should know (Part 90): Fenwick Tree Money Management with 1D CNN in MQL5
This article implements a Fenwick Tree (Binary Indexed Tree) for volume-aware money management inside an MQL5 Wizard Expert Advisor. We structure cumulative volume in O(log n) and apply four scaling modes—linear, conservative, aggressive, and mean-reversion—optionally gated by a lightweight 1D CNN. Practical tests compare the algorithm alone versus the CNN‑filtered approach to illustrate adaptive lot sizing and risk control under varying volume topologies.
Manual Backtesting with On-Chart Buttons in the MetaTrader 5 Strategy Tester
Manual Backtesting with On-Chart Buttons in the MetaTrader 5 Strategy Tester
Learn how to build a manual backtesting EA for MetaTrader 5's visual tester by adding chart buttons with CButton, executing orders through CTrade, and filtering positions with a magic number. The article implements Buy/Sell and Close All controls, configurable lot size and initial SL, and a trailing stop via CPositionInfo. You will also see how to load indicators with tester.tpl to validate ideas faster before automation and narrow optimization ranges.
MQL5 Trading Tools (Part 31): Creating an Interactive Tools Palette in MQL5
MQL5 Trading Tools (Part 31): Creating an Interactive Tools Palette in MQL5
We turn the Tools Palette sidebar from a static shell into an interactive MQL5 system. The article implements flyout menus per category, a chart event handler, a multi-click drawing engine (one-, two-, and three-click tools), and mouse interactions including drag, bottom-edge resize, scrolling, hover states, and live theme toggling. You will be able to select a tool and place chart objects directly from the palette for analysis
MetaTrader 5 Machine Learning Blueprint (Part 16): Nested CV for Unbiased Evaluation
MetaTrader 5 Machine Learning Blueprint (Part 16): Nested CV for Unbiased Evaluation
The article presents a V-in-V nested cross-validation pipeline for financial data that breaks leakage at three decision points: hyperparameter search, calibration, and final evaluation. A temporal three‑zone split isolates an inner walk‑forward search with the 1‑SE rule from an outer walk‑forward or CPCV evaluation, while OOF isotonic calibration is fitted independently. The resulting UnifiedValidationCalibrator delivers unbiased out‑of‑sample scores and well‑calibrated probabilities for deployment.
Position Management: Safe Pyramiding with a Unified Stop in MQL5
Position Management: Safe Pyramiding with a Unified Stop in MQL5
This article presents CPyramidEngine, a reusable MQL5 class that adds disciplined pyramiding to any Expert Advisor with about six lines of integration. The engine enforces three constraints: strictly decreasing lot sizes, a single unified stop that advances after each add-on, and broker-level validation of every modification. It explains common failure modes in naive implementations and shows how to keep total account risk quantifiable and controlled as positions are added.
MQL5 Wizard Techniques you should know (Part 89): Using Bitwise Vectorization with Perceptron Classifiers
MQL5 Wizard Techniques you should know (Part 89): Using Bitwise Vectorization with Perceptron Classifiers
This article presents a custom MQL5 signal class, CSignalBitwisePerceptron, for ultra-lightweight entry logic. It packs 64 bars into a single uint64 via bitwise vectorization and evaluates them with a perceptron that sums weights only for active bits. A two-gate flow (algorithmic hash map plus neural threshold) minimizes array iteration and heavy math. Readers get a practical template to cut latency and refine entry validation.
RiskGate: Centralized Risk Management for Multiple EAs
RiskGate: Centralized Risk Management for Multiple EAs
Many MetaTrader 5 setups run several EAs on one account, so risk gets fragmented and correlated exposure slips through. The article introduces RiskGate, a centralized Service that evaluates EA intents account‑wide: EAs send a JSON signal, the Service returns approved, lot and reason. You will see the client/server wiring, example rules (daily loss, exposure and correlation caps), unit‑tested handler design, and an EA example. The result is consistent portfolio‑level risk with simpler EAs.
The Power of MetaTrader 5: From Step-by-Step Debugging to EX5 Protection in a Unified Environment
The Power of MetaTrader 5: From Step-by-Step Debugging to EX5 Protection in a Unified Environment
This article examines a comprehensive approach to developing trading algorithms: from project setup and logic debugging to protecting the finished product. We will explore MetaEditor's built-in tools, including step-by-step debugging using real ticks, performance profiling, and direct integration with C++ DLLs to speed up calculations. The article also explains how to protect intellectual property using MQL5 Cloud Protector. The application of the described techniques will transform Expert Advisor development from a chaotic search for solutions into a systematic process, significantly reducing the time required to develop a strategy.
Trading with the MQL5 Economic Calendar (Part 11): Modular Canvas News Dashboard
Trading with the MQL5 Economic Calendar (Part 11): Modular Canvas News Dashboard
We rebuild the MQL5 Economic Calendar dashboard from a monolithic object-based panel into a modular canvas-based system split across four files. The update adds a dual light and dark theme, collapsible day groups, a resizable layout with pixel-based scrolling, revised value markers, and a live countdown with toast notifications. A candidate event cache and a fast-path timer that repaints only changed cells improve responsiveness and make the codebase easier to extend.
Trading with the MQL5 Economic Calendar (Part 12): SQLite Storage and Deduplication
Trading with the MQL5 Economic Calendar (Part 12): SQLite Storage and Deduplication
In this article, we replace the embedded CSV snapshot with a SQLite layer that persists calendar events and triggered trade IDs across restarts. The database lives in the common terminal folder and is shared by live charts and the strategy tester, so both modes read the same data without recompiling. An on-demand downloader with a canvas progress bar fetches history from the calendar API and stores it for offline reuse.
MQL5 Trading Tools (Part 32): Crosshair, Magnifier, and Measure Mode
MQL5 Trading Tools (Part 32): Crosshair, Magnifier, and Measure Mode
In this article, we extend the Tools Palette with a precision crosshair for MQL5 charts: reticle tick marks, full-width and full-height lines with axis labels, and a circular magnifier that renders zoomed candles. A double-click measure mode adds anchor markers, a diagonal connector, and a floating label with bars, pips, and price difference. Implementation details include a crosshair manager, eleven canvas layers, Bresenham line drawing, and theme-aware behavior that hides near the sidebar and fly out.
News Filtering with MetaTrader 5 Economic Calendar and CSV Fallback
News Filtering with MetaTrader 5 Economic Calendar and CSV Fallback
This article presents a self-contained news filter module for MetaTrader 5 built on the platform's economic calendar API. It implements symbol-to-currency mapping, pre- and post-event trading pauses, and optional position size reduction on high-impact days, with a CSV-based fallback for the Strategy Tester. A demo EA and live chart dashboard show integration and verification in both live and backtest environments.
Overcoming Accessibility Problems in MQL5 Trading Tools (Part IV): Remote voice trading
Overcoming Accessibility Problems in MQL5 Trading Tools (Part IV): Remote voice trading
Learn a practical way to execute MetaTrader 5 trades from Telegram voice notes using a Python middleware and an MQL5 EA acting as an HTTP client. The article covers architecture, WebRequest polling, in-memory queuing, JSON parsing with null-terminator stripping, and a constrained command grammar with a 0.001-lot default. You will configure the environment and validate round‑trip latency suitable for mobile data connections.
MQL5 Wizard Techniques you should know (Part 91): Using Skip Lists and a Hopfield Network in a Custom Trailing Class
MQL5 Wizard Techniques you should know (Part 91): Using Skip Lists and a Hopfield Network in a Custom Trailing Class
For our next Exploration on notions that are testable with the MQL5 Wizard we examine if Skip Lists and the Hopfield Network can give us a profit-guarding trailing strategy. Trailing Stop Management, as already argued, can be overlooked in most trading systems at the expense of Entry Signals or even Money Management. Trailing stops can make all the difference in certain situations such as trending markets, and thus we test this out with GBP USD.
Engineering a Self-Healing Expert Advisor in MQL5 (Part 1): Persistent Trade State Architecture
Engineering a Self-Healing Expert Advisor in MQL5 (Part 1): Persistent Trade State Architecture
This article demonstrates how to build the persistence foundation of a self-healing Expert Advisor in MQL5 using SQLite. Readers will learn how to create a permanent trade-state storage layer capable of surviving terminal restarts, shutdowns, and unexpected interruptions. The article covers SQLite integration in MetaTrader 5, database lifecycle management, persistent trade-state structures, and runtime state recovery using practical MQL5 implementations.
Keeping Memory Across Restarts: EA State Persistence Using Binary Files in MQL5
Keeping Memory Across Restarts: EA State Persistence Using Binary Files in MQL5
This article provides a structured MQL5 framework for serializing an Expert Advisor's internal state into local binary files. It prevents data resets during platform restarts by safely storing volatile tracking metrics, such as trade counts and multipliers, directly to disk. This architecture offers a more robust state continuity alternative to terminal Global Variables.