Skip to content
All library documents

Using Pearson Correlation to Compare Two Symbols

Article MQL5 code base

Summary

The document describes an indicator that calculates the Pearson correlation between a chart symbol and a user-selected second symbol. The user can configure the comparison period and applied price, along with minimum and maximum correlation settings that control the display’s color gradient from weaker to stronger readings.

Pearson correlation summarizes the direction and strength of a linear relationship between two data series using their observations, sample size, and standard deviations. The document gives these components but does not include the displayed formula, explain parameter selection, or show examples or test results. Correlation can help compare instruments, but the guide does not establish predictive power or address how readings may change across periods or market conditions.

Key ideas

  • The indicator compares a selected symbol with a second symbol using Pearson correlation.
  • The calculation uses two time series, their standard deviations, and the number of observations.
  • The period and applied price are user-configurable inputs.
  • A color gradient distinguishes weaker from stronger correlation readings.
  • The document offers no evidence that correlation readings predict future price moves.

Tags

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