Case study · MQL5 · Trading software

A five-in-one MetaTrader 5 indicator pack where every trading rule is tested without opening MetaTrader

The Confluence Pack combines four analysis indicators and a dashboard that reads them all, then tells the trader where the market is and which signals agree. I rebuilt it so every rule can be replayed against recorded prices in seconds and compared to known-good output, and so customers install a single file.

Role
Owner, architect, lead developer
Timeline
September – October 2026 in this codebase; version 6 under way
Status
Version 5.1.0 released 23 October 2026
commits in about four weeks
567
written design decisions
15
sets of byte-exact expected output ("goldens")
6
budget for the full check before any change reaches main
< 5 min
file for the customer to install
1

The problem

Why this needed building

What was wrong before

  • Behaviour could only be checked through MetaTrader's Strategy Tester: one terminal launch per check, 16 to 75 seconds each, and only with the terminal closed.
  • Logic was spread across indicator files, so the same rule could behave differently in two products.
  • Customers had to install and arrange five separate indicators.
  • Some dashboard text described trading theory that no indicator actually measured, and on a real chart it got the direction wrong.

What the product needed

  • Every rule provable by a fast, repeatable test, so changes don't silently alter signals.
  • A dashboard that only says what the indicators can show.
  • A one-file install with a single licence key.
  • Room to add AI features later without putting network access or trading inside the indicators.

Architecture

How it fits together

Select a box to see what it does, or pick a journey and press Play to follow it step by step.

Price data
Four analysis layers
Dashboard
Output & checks
The same layer code runs on live and recorded prices, so a passing test describes what customers get.
Price data
Four analysis layers
Dashboard
Output & checks

The same layer code runs on live and recorded prices, so a passing test describes what customers get.

Select any box

Each box is a part of the system

Click one to read what it does and why it was built that way.

Key decisions

What I chose, and what I rejected

Each one is a written decision record in the repository.

Rules replay against recorded prices; the Strategy Tester is only a smoke testTesting

Each product reads price data through a small interface. In production MetaTrader fills it; in tests a recorded CSV file does. All rule tests run in one terminal launch, with no tester settings to manage.

Rejected: proving behaviour through the Strategy Tester, at 16 to 75 seconds per check with the terminal closed. That is the test pyramid upside down: slow end-to-end runs where fast logic tests belong.

Thin indicator files; all logic in shared modulesArchitecture

Each indicator file only declares inputs and buffers and forwards events to one object. Logic lives in shared modules (market data, chart drawing, alerts, bus, licence) that every product uses.

Rejected: logic inside the indicator files, where it can't be tested on its own and drifts between products. A lint rule now blocks it.

The dashboard only states what an indicator measuredProduct

Every line of dashboard text names the published fact it rests on. If no indicator measures something, the dashboard doesn't say it until one does.

Rejected: writing the owner's trading theory into customer text. It sounded insightful, but on a real chart it called a bullish move in a clear downtrend.

One wave count, not twoTrading logic

Elliott Wave keeps a single count, with written rules for when a count is complete, invalid, probably dead or stale, and when a new one may start.

Rejected: holding a bullish and a bearish count at the same time. As I put it in the decision, a count is either right or wrong.

A time budget for the checksProcess

The full check must finish in under 5 minutes. A new check fits the budget or replaces an old one. An incident fixes its cause instead of adding a permanent guard.

Rejected: adding a guard, and then a test for the guard, after every incident. That grew the checks to 31 and about 12 minutes.

The pack stays offline; network and trading go in a separate EASecurity

The indicators' only network use is the licence check. Future AI features that need the internet, and anything that places trades, go into a separate, opt-in Companion EA. No indicator ever trades.

Rejected: putting web requests or trading into the indicators. MetaTrader blocks web requests in indicators, and trading needs the customer's explicit permission and its own risk controls.

Version 6: one indicator, one engineArchitecture

Version 5 runs the four layers as hidden indicators that talk to the dashboard through chart objects. Version 6 merges them into one engine that passes data in memory. It is being built in a new codebase, with this one frozen as a reference.

Rejected: keeping the message-passing design. Its timing machinery (hidden hosts, staleness timers, heartbeats) was where the timing bugs lived. Speed was not the reason: it will be measured before and after, not claimed.

In production

Problems found, and how I fixed them

Each fix came from evidence: a real chart, timings, or the commit history. Some of the problems were in the product and some were in how it was being built.

The dashboard called a bullish wave in a clear downtrendProduct

Symptom

On a real chart, the dashboard's text described the setup as a bullish Wave 3 while the market was clearly falling.

Diagnosis

The text came from a trading theory written into the engine, not from anything an indicator measured.

Fix

Removed the theory from customer text. Every dashboard line now names the published fact it is based on.

Checks took 12 minutes, and much of the work was on the checksProcess

Symptom

The full check had grown to 31 steps and about 12 minutes. 47 of 255 commits in a month were work on the checks themselves.

Diagnosis

Every incident added a permanent guard, then a test of that guard. Most of it was policing the agents, not testing the product.

Fix

Set a 5-minute budget, deleted the checks that only tested other checks, and made incidents fix their cause.

Behaviour tests were slow and fragileTesting

Symptom

Each behaviour check launched a MetaTrader terminal and the Strategy Tester, and couldn't run while the terminal was open.

Diagnosis

The indicator logic read prices straight from MetaTrader, so there was no way to feed it test data.

Fix

Added a data seam to each product, recorded real price data as fixtures, and moved all rule tests into one fast script run.

Process nobody had heard ofProcess

Symptom

About 30 files carried warning banners, a lint rule policed what comments could say, and around ten commits went into rewording comments to satisfy it.

Diagnosis

These mechanisms had been invented along the way and matched no recognised engineering practice.

Fix

New rule: every process step must map to a published practice, or have its own written reason. The invented ones were removed.

Timing bugs between the dashboard and its layersReliability

Symptom

The dashboard sometimes worked from stale or missing facts.

Diagnosis

Each layer turned its data into text on the chart and the dashboard parsed it back, with timers and heartbeats to detect staleness. Most of the timing faults were in that round trip.

Fix

Version 6 removes the round trip: one indicator, one engine, data passed in memory. Only the bus golden changes; every layer's own tests stay.

Method

How I built it

  1. 1

    The code and the tests are the specification. Changing behaviour means changing a test in the same commit, and any rule without a test is listed in one place until it gets one.

  2. 2

    Expected output is only re-approved when a behaviour change is intended, so an accidental change can't slip in as a "new baseline".

  3. 3

    Trading rules came from me as the domain owner, checked against hand-labelled chart snapshots.

  4. 4

    I used AI coding agents (Claude Code, Codex) under my direction. I wrote the specs, decisions and acceptance tests, then reviewed and verified the output.

Stack

Technology

  • MQL5
  • MetaTrader 5
  • Object-oriented MQL5 modules
  • Golden-file testing
  • CSV market-data fixtures
  • PowerShell build & test tooling
  • JavaScript (rule twin for review sheets)
  • ONNX (planned, offline models)

What this means for your project

If you have an MT4/MT5 indicator or EA that nobody dares change, I can put its rules under tests that replay recorded prices, so you can change it safely.

I can also merge several indicators into one product, add licensing, or port a TradingView script to MQL5 with tests that prove the two versions agree.

Get in touch →

This page describes how the software is built. It makes no claims about trading performance, and internal details are deliberately left out. The source code is proprietary; I'm happy to walk you through it live on a call.