PSI SQUARE • case study • algorithmic trading

MT5 Multi-Symbol Arbitrage EA

A statistical arbitrage Expert Advisor built in MQL5 to exploit mean-reversion spreads across correlated FX pairs simultaneously on MetaTrader 5. Delivered from scoping to live deployment in 3 weeks. Zero critical errors in 60 days of live production trading.

MT5MQL5Statistical ArbitrageMulti-SymbolProp Firm
THE CHALLENGE

The challenge

A quantitative prop trader needed to automate a manual statistical arbitrage strategy running across 12 correlated FX pairs on MT5. The strategy required real-time spread monitoring across all pairs simultaneously, dynamic entry/exit triggers based on Z-score deviation thresholds, and strict prop firm drawdown compliance — all without any execution lag that would erode the arbitrage edge.

Key Project Constraints & Requirements

Multi-Symbol Execution

Must monitor 12 pairs simultaneously from a single EA instance

Dynamic Statistical Signal

Entry logic tied to rolling Z-score across a dynamic lookback window

Global Prop Firm Risk Guard

Global account equity protection: 4% daily loss limit, 8% trailing drawdown

Tick-Accurate Validation

Strategy Tester validation required before live deployment

Aggressive Delivery Window

Timeline: 3 weeks from scoping to live production trading

THE SOLUTION

The solution

PSI Square engineered a fully object-oriented MQL5 Expert Advisor leveraging MT5's native multi-symbol capability — the EA runs from a single chart instance while monitoring and trading across all 12 pairs in real time.

Data Pipeline

Symbol Manager Class

Handles real-time price feeds, spread monitoring, and Z-score calculation across all 12 pairs using a rolling lookback buffer.

Signal Logic

Signal Engine

Fires entry/exit signals when Z-score crosses configurable deviation thresholds in either direction with sub-millisecond evaluation.

Risk Management

Portfolio Risk Controller

Aggregates floating equity across all open positions in real time, throttles new entries when exposure approaches limits, and triggers atomic position flattening at hard stop thresholds.

Async Routing

Execution Layer

Uses MT5's OrderSendAsync for non-blocking order submission, with custom fill-policy handling (FOK / IOC / Return) per broker.

THE ARCHITECTURE

Technical architecture

A breakdown of the core platform specifications, execution framework, and risk controls engineered for this production deployment.

Platform
MetaTrader 5 (MT5)
Language
MQL5 (object-oriented)
Execution
OrderSendAsync — non-blocking, broker fill-policy aware
Symbols Monitored
12 correlated FX pairs from single EA instance
Signal Logic
Rolling Z-score with configurable deviation threshold
Risk Model
Centralized portfolio equity controller
Validation
Strategy Tester — 6 years real broker tick data
Drawdown Guard
4% daily / 8% trailing — atomic flatten on breach
Timeline
3 weeks: scoping → architecture → build → test → live
VERIFIED OUTCOME

Verified outcome

Measured results and performance benchmarks validated over 60 days of continuous live market operations.

3 weeks
Scoping to live deployment
Full architecture, testing & live deployment
0 critical errors
In 60 days of live trading
100% execution uptime across all pairs
12 pairs
Monitored simultaneously
Single chart instance on MetaTrader 5

Production Deployment & Post-Launch Performance

The EA went live within 3 weeks of the initial scoping call. After 60 days of continuous live trading across all 12 pairs, the system recorded zero critical execution errors and maintained maximum drawdown well within the prop firm's required thresholds. The client has since expanded the strategy to additional symbol groups using the same core architecture.

GET IN TOUCH

Ready to build your trading system?

Whether you need a simple Expert Advisor or a complex multi-broker trading infrastructure — tell us what you're building. We'll scope it, design it and deliver it to production standard.

Or email info@psi-square.net · Phone +44 (0) 20 3872 7195 · We reply within 24 hours · NDA available on request