Custom MT5 Data Feed for Live Strategy Execution
Problem
Some brokers like FXCM and OANDA provide their own APIs for data feed and execution. But most CFD brokers — IC Markets, Vantage, Pepperstone — have no manager API. You cannot programmatically get price data or execute trades through a REST endpoint. Third-party data APIs like Polygon or Twelve Data give you generic aggregated prices, but those are not the prices your broker quotes. The spread, the slippage, the exact tick — they differ between brokers. If your strategy backtests on Polygon data but executes on IC Markets prices, the results will not match.
Approach
Built a custom MQL5 Expert Advisor that runs inside the broker's own MT5 terminal and captures every tick at the source. The EA builds OHLC candles at multiple timeframes simultaneously and pushes them via HTTP POST to a Node.js ingestion service on each candle close. This gives us the 1:1 correct price feed based on the exact broker we are operating from — not approximated data from a third party. The entire setup runs in a Dockerized headless MT5 instance on Linux using Wine, so it operates 24/5 without a desktop.
Outcome
Strategies execute on the same prices they were designed for. Zero discrepancy between backtest data and live execution. Eliminated the $200+/month cost of third-party data APIs and their rate limits. The feed runs autonomously with health monitoring that auto-restarts the container if the EA stops sending data.