Articles on trading system automation in MQL5

icon

Read articles on the trading systems with a wide variety of ideas at the core. Learn how to use statistical methods and patterns on candlestick charts, how to filter signals and where to use semaphore indicators.

The MQL5 Wizard will help you create robots without programming to quickly check your trading ideas. Use the Wizard to learn about genetic algorithms.

Add a new article
latest | best
preview
Aggregating Multi-Broker Tick Feeds into a Synthetic Mid-Price in MQL5

Aggregating Multi-Broker Tick Feeds into a Synthetic Mid-Price in MQL5

This article shows how to aggregate quotes from multiple brokers in MQL5 via a simple file‑based bridge. Publisher EAs write bid, ask, and volume per tick; a timer-driven master EA validates inputs, excludes stale feeds, and produces a volume-weighted synthetic mid-price. The EA publishes the series to a custom symbol you can chart and test; the design was exercised on three broker demo accounts.
preview
MQL5 Developer Gotchas (Part 2): A Multi-Line Text Block for Chart Labels Beyond the 63-Character Limit

MQL5 Developer Gotchas (Part 2): A Multi-Line Text Block for Chart Labels Beyond the 63-Character Limit

CLabelBlock lets an EA show a long text as labels wrapped by pixel width and detect a truncated label. On the tested builds, native text objects and object names keep only the first 63 UTF-16 code units without an error. CCanvasBlock draws wider lines on one bitmap without that cap but cannot read its text back. Unit tests and screenshot checks cover one system and a few fonts.
preview
Implementing a Zone-Aware Rollover Window Gate in MQL5

Implementing a Zone-Aware Rollover Window Gate in MQL5

CTradeWindows blocks EA entries during the daily rollover spread spike. Each window is a clock time in a zone such as New York, so it follows that zone through DST. CSpreadProfile learns the windows from tick spreads and saves them to a file that an EA can load. Unit tests and Strategy Tester runs on one server show that a window fixed in server time misses the spike in weeks when the US and EU DST dates differ.
preview
Neural Networks in Trading: Difference-Based Modeling of Market Microstructure (EDCFlow)

Neural Networks in Trading: Difference-Based Modeling of Market Microstructure (EDCFlow)

In the article, we explore the EDCFlow framework, which offers a new approach to analyzing market microstructure. It combines state correlation with a difference map, making it possible to identify subtle dynamic changes in the market. The model's architecture effectively aggregates multiscale features with minimal computational cost, making it suitable for real-time analysis.
preview
Multi-Timeframe Bar Aggregator with Conflict Detection in MQL5

Multi-Timeframe Bar Aggregator with Conflict Detection in MQL5

We implement a multi‑timeframe aggregator that prevents mixing bars from different moments. It validates grid alignment, recency to the forming base bar, and closed‑bar end times, and returns either a complete bundle or a structured error. A re‑read guards against races with a new base bar, while a fake bar source powers fifteen reproducible tests and a demo indicator that plots on valid data only.
preview
Automating Trading Strategies in MQL5 (Part 54): Consolidation Breakout and Retest Entry Model

Automating Trading Strategies in MQL5 (Part 54): Consolidation Breakout and Retest Entry Model

We implement an MQL5 program that validates consolidations by counting edge switches, height capped to the typical candle, and net drift, then requires a buffered close beyond an edge and a move away before arming. Entry follows a return to the broken edge and a strong close back on the breakout side. The stop anchors beyond the retest extreme; the target is an R-multiple, and failed attempts can rearm the same range after a fresh breakout and retest.
preview
Aggregating Economic Calendar Events into a Structured MQL5 Data Feed

Aggregating Economic Calendar Events into a Structured MQL5 Data Feed

The package builds a news feed from CalendarValueHistory(): it filters by impact and currency, maps events to a symbol universe, and stores them in a time‑sorted array with minutes to event. You can query GetNextEvent() and IsInNewsWindow() to implement deterministic news filtering in an EA. An abstract source and clock, plus terminal and fake implementations, enable testing when calendar functions are unavailable in the Strategy Tester.
preview
Auditing an Expert Advisor From Its Trade History (Part 1): Rebuilding Positions From Deals

Auditing an Expert Advisor From Its Trade History (Part 1): Rebuilding Positions From Deals

This article introduces TradeAudit, an MQL5 include library that rebuilds closed trades from raw deal history to produce one consistent record per trade. It handles partial closes, scale-ins on netting accounts, netting reversals, close-by pairs, and positions spanning the date range. A script exports the records to CSV, and a self-test script runs synthetic netting and close-by sequences. The result is a clean per-trade dataset for reliable EA statistics and verification.