Skip to content
All library documents

Bollinger Band Mean Reversion on a YM–NQ Price Spread

Article TradingView scripts

Summary

This example builds a spread-like series from the closing prices of the YM and NQ futures contracts. It smooths their price ratio with a long moving average, uses that ratio to scale one contract against the other, and calculates Bollinger Bands around the resulting difference. A long signal occurs when the difference crosses below the lower band, while a short signal occurs above the upper band; positions close when the series crosses back through the middle band.

The author presents the approach as an experiment with a cointegration rationale, but explicitly says the selected instruments did not pass their cointegration check. The TradingView strategy also trades only one instrument, so its results do not represent a hedged two-leg pair trade. The author warns of large drawdown, and the document provides no detailed test period, costs, or statistical validation. The band-crossing rules illustrate spread mean reversion, but the hedge ratio and suitability of the pair require independent testing.

Key ideas

  • The strategy approximates a YM–NQ spread by scaling one futures price with a smoothed price ratio.
  • Bollinger Band excursions define entries, and a return to the middle band defines exits.
  • The author reports that the chosen instruments were not cointegrated in their check.
  • The backtest takes single-instrument positions rather than simultaneously trading both legs.
  • The author warns of large drawdown, with no detailed performance validation provided.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.