Two rival trading platforms and phantom data re-anchored to the broker

← all writing

02

$540k of phantom data, and the real lesson underneath it

Most data problems are really undeclared source-of-truth problems.

The problem

Traders on FXVPS run automated strategies across MetaTrader 4 and MetaTrader 5. They expect a single, trustworthy view of performance, but their trade history arrives from two platforms that each behave as though they are the source of truth.

Ingest both streams naively and the cracks begin to appear. Duplicate trades are counted twice, trading volume is inflated, and balance and credit events quietly masquerade as P&L. None of the numbers look obviously wrong. They look plausible, which is exactly what makes reconciliation bugs so dangerous.

A reconciliation error rarely announces itself. It simply produces reports that are consistently, confidently wrong.
Diagram of MetaTrader 4 and MetaTrader 5, each claiming to be the source of truth, feeding an ingestion pipeline that de-duplicates and re-anchors P&L to broker records.
Two platforms, each convinced it is right. The pipeline de-duplicates and filters, then re-anchors every account’s P&L to one authority: the broker.

What I found

A cross-platform reconciliation pass uncovered $540k of phantom data across seven accounts: duplicated volume and positions that did not correspond to anything real.

Once that noise was removed, a further $4k of genuine accounting drift became visible underneath. The real discrepancy had been there all along; it was simply buried beneath much larger inconsistencies.

Funnel diagram: $540k of phantom data from duplicates and unreal positions, filtered away to reveal $4k of genuine accounting drift.
The real error was tiny. It only became findable once the far larger phantom data was stripped away.

What I built

The fix was not a more complicated reconciliation algorithm. It started with making the source of truth explicit.

  • Platform-aware duplicate detection.
  • Balance and credit filtering.
  • Broker-anchored P&L reconciliation.

Rather than trusting either trading platform’s local view, every account’s P&L is re-anchored to the broker’s records. The migration itself was ordered index-first, allowing the reconciliation job to complete within the host’s boot window instead of competing with the rest of the startup process.

Diagram showing MT4 and MT5 disagreeing on an account balance, resolved by treating the broker record as the authority.
When two systems disagree, something has to be allowed to be right. Naming that authority, on paper, is the whole job.

The real lesson

Most data problems are not really data problems. They are undeclared source-of-truth problems.

The interesting engineering challenge was never the deduplication maths. It was deciding, before writing a line of reconciliation code, which system was allowed to be right when two systems disagreed. Once that decision existed on paper, the reconciliation logic became straightforward.

Name the source of truth first.

The rest of the pipeline tends to follow.

Go, PHP, MT4/MT5, Railway, multi-tenant data pipeline.

// let's talk

Have a system worth getting right?

Book a call

or email [email protected] · find me on LinkedIn