Skip to content
All library documents

Using Rolling Correlation to Compare Two Trading Symbols

Article MQL5 code base

Summary

The document explains a correlation indicator for comparing price changes in two symbols. It describes values from positive one to negative one: positive values indicate prices tending to move together, negative values indicate movement in opposite directions, and zero indicates no measured correlation. The lookback period controls the horizon, with longer windows suited to observing persistent co-movement and shorter windows intended to highlight sudden divergence, such as when news affects one symbol but not the other. If a symbol is omitted, the current chart symbol is used.

It suggests watching for a break in the usual relationship and trading in the direction of the symbol that remains aligned with the prior pattern. It considers readings above 0.8 or below -0.8 highly correlated. These are heuristic suggestions rather than a tested trading system: the text gives no evidence on profitability, risk controls, or false signals, and correlation can change over time. Using the same symbol twice always yields a value of one.

Key ideas

  • Correlation values range from positive one for aligned movement to negative one for opposing movement.
  • The selected lookback period changes whether the indicator emphasizes longer-term co-movement or short-term changes.
  • The text suggests examining which symbol deviates when a historically strong relationship breaks.
  • Readings beyond 0.8 or below negative 0.8 are presented as high correlation.
  • The proposed entry idea is heuristic and comes without performance or risk evidence.

Tags

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