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

← all writing

02

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 phantom data across seven accounts: duplicated fills and positions that did not correspond to anything real. On one account, 837 rows were surplus: 40.5% of its history. A $100,000 demo deposit had even been booked as a trade.

Once that noise was removed, the real number appeared. The dashboard had said +$7,407; the broker said −$5,018. The truth had been there all along; it was simply buried beneath rows that should never have existed.

Funnel diagram: phantom rows from duplicates and unreal positions, filtered away to reveal the broker figure of −$5,018 behind a dashboard showing +$7,407.
The dashboard was confidently wrong. The real figure only appeared once the phantom rows were 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 main@eaymon.com · find me on LinkedIn