Dear All,
A new Correl() function is now available in the rules. You will find it under: TECHNICAL INDICATORS->VOLATILITY
Here’s the documentation:
Correl(period , samples , series [, series2])
This function can be used to calculate the correlation coefficient (-1.0 to 1.0) of the stock being examined with a series. If a second series is specified it calculates the correlation coefficient between them.
Parameters
period: number of bars used for calculating returns
samples: number of samples
series: the first series (see below)
series2: the second series (optional)
Examples
- Calculate the correlation of the 1 day returns for the past three months of the stock vs. it’s industry
Correl(1,62,#Industry)
- Calculate the correlation of the 5 day returns for the past year of the stock vs. the S&P500.
Correl(5,50,GetSeries(“$SP500”))
NOTE: Do not use the SP500 for non-USA stocks, rather use a benchmark for the same country to line-up the holidays.