Pairs Trading Strategy Explained: How YMI Uses ML Correlation Analysis to Trade ES vs NQ
Strategy

Pairs Trading Strategy Explained: How YMI Uses ML Correlation Analysis to Trade ES vs NQ

Young Money Investments
·
March 21, 2026
·
10 min read

Most trading strategies ask one question: will price go up or down? Pairs trading asks a different question: have two historically correlated instruments diverged beyond their typical relationship, and is that divergence likely to revert? The directional question is almost irrelevant — what matters is the spread between two instruments, not where either one is going individually.

The YMI Pairs Trading strategy is built on exactly this framework: machine learning-driven correlation analysis between ES (E-mini S&P 500) and NQ (E-mini Nasdaq 100), two futures markets that move in tight lockstep the majority of the time — until they don't.

Why ES and NQ Are the Ideal Pairs Trading Instruments

Pairs trading requires two instruments with a stable, persistent relationship — not just a temporary correlation that happens during one market regime and collapses in another. ES and NQ satisfy this requirement better than almost any other futures pair:

  • Structural overlap: The S&P 500 and Nasdaq 100 share approximately 68% of their top holdings. When large-cap technology stocks move, both indexes move. This isn't coincidence — it's structural overlap that makes the relationship persistent through market cycles.
  • High liquidity: Both ES and NQ are among the most liquid futures contracts in the world, with tight bid-ask spreads and deep order books. Entering and exiting positions at intended prices is feasible even at meaningful contract counts.
  • Different volatility profiles: NQ is approximately 1.8–2.2x more volatile than ES on a typical day. This volatility differential is predictable enough to model, which is what creates the edge — when NQ's relative move deviates significantly beyond its typical volatility premium, it tends to normalize.
  • Same trading hours and exchange: Both trade on the CME Group in the same time zones, eliminating settlement timing issues that plague equity pairs traded across exchanges.

The Statistical Foundation: Cointegration vs. Correlation

Trade This Systematically

Stop reading. Start executing.

Join 500+ traders using YMI's automated bots, daily KPLs, and AI trade plans — no guesswork required.

Regular traders confuse correlation and cointegration. The distinction is critical for pairs trading.

Correlation measures whether two instruments tend to move in the same direction at the same time. ES and NQ are highly correlated — both go up in bull markets and down in bear markets. But correlation alone doesn't tell you that a spread between them will revert.

Cointegration means that even though two instruments each follow a random walk independently, their spread — the ratio or difference between them — follows a stationary process that mean-reverts. Cointegrated pairs don't just move together; their relationship has a mathematical anchor that pulls divergences back toward equilibrium.

ES and NQ are cointegrated. The spread between them has a long-run equilibrium ratio. When that ratio deviates significantly — because ES sold off harder than NQ on a given day, or NQ ripped higher on AI news while ES lagged — the statistical expectation is convergence back toward the mean spread.

The YMI Pairs Trading model uses the Engle-Granger cointegration test on rolling windows (typically 60–90 trading days) to verify the relationship remains stationary before taking trades. If the test shows the spread is no longer cointegrated during a given period (which can happen during major regime shifts), no trades are taken.

Where ML Correlation Analysis Comes In

Classical pairs trading uses fixed ratio models — trade when the z-score of the spread exceeds +2 or -2 standard deviations, exit when it returns to 0. This works, but it treats the relationship as static. The YMI approach improves on this with a dynamic correlation model:

  1. Rolling window correlations: Instead of a fixed ratio, the model recalculates the ES/NQ relationship using a rolling window that adapts to recent price action. During earnings seasons when tech stocks dominate, NQ typically leads; during macro events like FOMC, ES often leads. The model weights recent data more heavily during regime transitions.
  2. Volatility regime adjustment: The standard deviation of the spread varies significantly by market regime — spreads widen during high-VIX periods and compress during low-VIX periods. Using a single static threshold misses this. The model scales entry thresholds by realized volatility of the spread over the past 10 sessions.
  3. Lead-lag detection: During strong trending periods, one instrument often leads the other by a predictable lag. Cross-correlation analysis over different lookback windows identifies whether ES or NQ is currently leading, and adjusts position sizing accordingly. If NQ leads and ES is lagging, a smaller long ES / short NQ position is appropriate; the lag might resolve quickly.
  4. Correlation breakdown filters: The model monitors for correlation breakdown signals — sustained divergences in the same direction that suggest a genuine regime change rather than mean-revertible noise. When ES and NQ are moving apart for 3+ consecutive sessions without reverting, the model flags a potential structural break and reduces position sizing until cointegration is re-confirmed.

Trade Execution: Long/Short Position Construction

A pairs trade on ES/NQ is not a directional bet — it's a spread trade. You're simultaneously long one instrument and short the other. The trade profits if the spread normalizes, regardless of whether both instruments go up, both go down, or one goes up and one goes down.

Spread entry signal: When the z-score of the current ES/NQ spread exceeds 2.0 standard deviations from its rolling mean, a trade is initiated. Direction depends on which side is extended:

  • If ES is relatively cheap vs NQ (spread is negative z-score): Long ES, Short NQ — bet that ES will catch up or NQ will fall back.
  • If NQ is relatively cheap vs ES (spread is positive z-score): Long NQ, Short ES — bet that NQ will catch up or ES will fall back.

Contract ratio: Raw contract counts aren't meaningful — 1 ES contract controls ~$280,000 in S&P 500 exposure; 1 NQ contract controls ~$420,000 in Nasdaq 100 exposure. The model normalizes by dollar exposure. A typical trade might be: Long 3 ES contracts, Short 2 NQ contracts to create approximately dollar-neutral positions.

Target exit: The position is closed when the spread's z-score returns within 0.5 standard deviations of the mean — not necessarily at exactly zero. Waiting for perfect mean reversion leaves money on the table and increases the risk of the trade reversing before full convergence.

Stop loss: If the z-score widens to 3.5+ standard deviations in the same direction (instead of reverting), the trade is stopped out. This is the signal that the trade thesis has failed — either the regime changed or an external shock has permanently altered the relationship in this window.

When Pairs Trading Works — and When It Doesn't

Pairs trading has genuinely different performance characteristics from directional strategies like Marty Bot or the KPL strategy. Understanding these characteristics prevents misapplied expectations:

Pairs trading excels during:

  • Range-bound, low-trend markets where directional strategies struggle
  • Sector rotation periods where tech and broad market diverge temporarily
  • Periods of high relative volatility in one index vs. the other (earnings seasons, tech-specific events)
  • Markets with moderate-to-high correlation between ES and NQ (0.85+)

Pairs trading struggles during:

  • Macro events that structurally reprice one index vs. the other — a trade policy that permanently disadvantages tech stocks, for instance, would break the ES/NQ spread assumption
  • Crisis markets where correlations go to 1.0 — when everything crashes together, there's no spread to trade
  • Very low-volatility, ultra-narrow-range markets where spreads rarely reach entry thresholds

This is why pairs trading works best as a complementary strategy alongside directional systems. When Marty Bot and the KPL Bot are struggling in trending markets, the pairs strategy often continues producing returns. When markets are range-bound, pairs trading activates while directional strategies sit flat.

Portfolio Integration: Pairs Trading as a Hedge

The deeper value of pairs trading for YMI Pro members isn't just the additional trade count — it's the portfolio-level effect. Because pairs trades have near-zero directional market exposure (long ES, short NQ is roughly market-neutral), they're uncorrelated with your directional bot positions.

In a portfolio with Marty Bot (mean reversion), KPL Bot (directional breakout), and Pairs Trading (spread mean reversion), all three strategies can be profitable simultaneously without one canceling the other. More importantly, on bad directional days — sessions where both bots stop out on false breakouts — the pairs strategy may still extract returns from spread normalization.

This diversification across strategy types is the backbone of the YMI Pro framework: not more risk, but more uncorrelated edge sources. The goal is a portfolio where there are fewer "zero days" where every strategy struggles simultaneously.

Accessing the YMI Pairs Trading Strategy

The YMI Pairs Trading strategy — including the ML correlation analysis model, dynamic z-score entry signals, and NinjaTrader 8 execution scripts — is available exclusively to Pro Trader members. It requires:

  • NinjaTrader 8 with two connected instruments (ES and NQ data feeds)
  • Two prop firm accounts or one live account with sufficient margin for simultaneous long/short positions
  • Familiarity with multi-account execution (covered in the onboarding session)

New Pro members receive a dedicated pairs trading onboarding walkthrough covering correlation analysis dashboard setup, position sizing calculators, and historical backtest results across the past 3 years of ES/NQ data.

Related reading:

About the Author

YMI Team
YMI Team

Young Money Investments

The YMI team creates educational content on systematic futures trading, automated bots, and prop firm strategies.

Quantitative TradingFutures Specialist

Free — No Credit Card

Get Daily KPLs in Your Inbox

AI-generated Key Price Levels for ES & NQ, delivered every trading morning. Join 500+ traders who start their session with a plan.

🔒 Your information is secure. We respect your privacy and will never spam you.

Risk Disclosure & Disclaimer

Educational Purposes Only: The content provided in this blog is for educational and informational purposes only. It does not constitute financial, investment, or trading advice. Young Money Investments is not a registered investment advisor, broker-dealer, or financial analyst.

Risk Warning: Trading futures, forex, stocks, and cryptocurrencies involves a substantial risk of loss and is not suitable for every investor. The valuation of futures, stocks, and options may fluctuate, and as a result, clients may lose more than their original investment.

CFTC Rule 4.41 - Hypothetical or Simulated Performance Results: Certain results (including backtests mentioned in these articles) are hypothetical. Hypothetical performance results have many inherent limitations. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. In fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program.

Testimonials: Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

Ready to Apply These Strategies?

Join 500+ traders using YMI's automated bots, daily KPLs, and AI trade plans to trade systematically.

Intro Trader includes a 7-day free trial • 30-day money-back guarantee on all tiers