Custom development and premium support

Linear correlation between two symbols

# Correlation

Check if two symbols act similarly, if they always go together: either the same direction or the opposite.

[this div will be converted to an iframe]
×

### Correlation

Check if two symbols act similarly, if they always go together: either the same direction or the opposite.

#### Free

Before downloading our products you must accept our Terms & Conditions.

#### Share

The indicator helps to identify the correlation between two symbols.

Correlation is a degree of dependence between two values, for example, between prices. The Correlation indicator displays the dependency between any two instrument. The correlation ranges from -1 to 1.

When the correlation is equal to -1 it means that symbols behave in an opposite way, e.g. when the price of the first symbol goes up, the price of the second symbol goes down and vice versa.

When the correlation is equal to 1 it means that symbols behave the same way, e.g. when the price of the first symbol changes, the price of the second symbol changes in the same direction.

When the correlation is equal to 0 it means that symbols are completely independent, i.e. it is not possible to predict one price by another.

The indicator supports the following correlation types:

• Pearson: Pearson's correlation coefficient (Pearsons Correlation Coefficient's) - a measure of the correlation (linear dependence) between two samples X and Y, taking values ​​between +1 and -1 inclusive. In other words, the Pearson correlation coefficient characterizes the existence of a linear relationship between two variables. Equality coefficient "1" indicates a strict linear relationship, "-1" - on the back. If the coefficient is zero, the sample is linearly independent.
• Rank: Spearman's rank correlation coefficient - refers to the non-parametric indicators of relationships between variables measured in the rank scale. In calculating this ratio requires no assumptions about the distribution characteristics in the general population. This ratio determines the degree of closeness of the connection sequence features, which in this case are the ranks of the compared values.The coefficient of linear correlation Spearman also lies in the range of +1 and -1. He, like the Pearson coefficient may be positive or negative, describing the orientation relationship between the two traits measured in the rank scale.
• Residual: partial correlation coefficient for the multiple regression model through indicator residual variance.
• PctChange: coefficient of correlation percentage difference between the closing price of consecutive bars.

#### How to use

Correlation indicator allows to understand if two symbols act similarly. For example, if you find out that the correlation between ABC and XYZ is 0.85 then there is a good chance that they will react same way. If the correlation between ABC and XYZ is negative, say -0.85 then it means XYZ raises up when ABC is falling and XYZ falls down up when ABC is raising.

Companies from the same sector can be positively correlated.

#### Requirements

• This indicator requires NinjaTrader version 7

#### Installation

1. Save the zip-file (no need to unzip) to the location of your choice

2. Go to menu Control Center -> File -> Utilities -> Import NinjaScript...

3. Select the saved zip-file in the opened dialog

4. If everything is OK you will see a confirmation (otherwise an error will be displayed)

5. Restart NinjaTrader and you are good to go!