"

Correlation

by Dr.Hamdi Boukamcha
Name:
Correlation [ ru | cn ]
Author: Scriptor (2009.01.07 09:28)
Rating: 8
Downloaded: 4039
Download:
Correlation   Correlation.mq4 (3.4 Kb) View
The indicator calculates the correlation of the currency pairs.

Input Parameters:

extern string OtherChart="EURUSD";
extern int n=20;
extern bool UseOpen=true;
extern bool UseClose=false;
extern bool UseHigh=false;
extern bool UseLow=false;
extern int CalcBars=400;

Calculation Formula :
Correlation
where

Correlation  and

Correlation  are the prices of two assets on the same TF. n is the period the correlation is calculated for. x and y (with the dashes above them) are the average values of x and y for the last n bars.

 

Example with USDCHF and EURUSD:

Correlation

Correlation

Share this article

Leave a comment