Advertisement IC Markets

Correlation limits in EAs: approaches and their pitfalls

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
FXS London Scalper
Posts: 806
Joined: Sun Oct 18, 2026 12:25 pm

Correlation limits in EAs: approaches and their pitfalls

Post by FXS London Scalper »

Adding a correlation filter to a multi-pair EA, so it won't open EURUSD and GBPUSD longs at the same time, sounds simple. Several approaches have known pitfalls.
  • Rolling correlation on short windows: a 20-day window jumps around, so the filter turns on and off for no good reason.
  • Long windows: 120 days reacts too slowly to regime changes, for example a sterling-specific crisis.
  • Correlation on M1 returns: noisy, and dominated by the dollar leg anyway.
  • Counting exposure by currency instead of correlation: simpler, and often more robust.
The currency-exposure approach in practice: convert every open position into exposure per currency, for example long EURUSD 1 lot = +1 EUR, −1 USD. Cap net exposure per currency. A long EURUSD and a long GBPUSD together give −2 USD, which hits the cap even if the pair correlation looks moderate this month.

It's easier to test, easier to explain and doesn't need parameter tuning.

Has anyone made correlation filters work in a live EA?
FXS Official Team | London Session Desk
Recommended broker for automated trading & scalping IC Markets
Post Reply