# Technical Studies Reference

### Correlation Coefficient

The study calculates and displays the Correlation Coefficient between the variables specified by the Input Arrays 1 and 2 Inputs. These Input arrays can refer to any Subgraph of the Main Price Graph or any study on the chart.

Let $$X$$ and $$Y$$ be random variables denoting Input Array 1 and Input Array 2, respectively, and let $$X_i$$ and $$Y_i$$ be their respective values at Index $$i$$. Let the Input Length be denoted as $$n$$. Then we denote the Correlation Coefficient at Index $$t$$ as $$\rho_t(X,Y,n)$$ (Greek letter rho), and we compute it in terms of Simple Moving Averages for $$t \geq n$$ as follows.

$$\rho_t(X,Y,n) = \displaystyle{\frac{\sum_{i = t - n + 1}^t(X_i - MA_t(X,n))(Y_i - MA_t(Y,n))}{\sqrt{\sum_{i = t - n + 1}^t(X_i - MA_t(X,n))^2}\sqrt{\sum_{i = t - n + 1}^t(Y_i - MA_t(Y,n))^2}}}$$

For an explanation of the Sigma ($$\Sigma$$) notation for summation, refer to our description here.

#### Inputs

• Input Array 1: This Input is used to select the first Input array to use in the Correlation Coefficient calculation. There are two list boxes displayed. The first one is for selecting the main price graph or a study on the chart. The second one selects a specific Subgraph within that selected main price graph or study, to use the data from.

It is possible to reference the main price graph or study data from another chart. Open the other chart you want to reference. Add the Study/Price Overlay study to the chart containing the Correlation Coefficient study. Configure the Study/Price Overlay study as you require. Once the Study/Price Overlay study is on the chart, you will then be able to set Input Array 1 to this study that is referencing data from another chart.
• Input Array 2: This Input is used to select the second Input array to use in the Correlation Coefficient calculation. There are two list boxes displayed. The first one is for selecting the main price graph or a study on the chart. The second one selects a specific Subgraph within that selected main price graph or study, to use the data from.

It is possible to reference the main price graph or study data from another chart. Open the other chart you want to reference. Add the Study/Price Overlay study to the chart containing the Correlation Coefficient study. Configure the Study/Price Overlay study as you require. Once the Study/Price Overlay study is on the chart, you will then be able to set Input Array 2 to this study that is referencing data from another chart.
• Length