NEW: Correlation function to calculate Correlation Coefficient in rules

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

  1. Calculate the correlation of the 1 day returns for the past three months of the stock vs. it’s industry

Correl(1,62,#Industry)

  1. 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.

Interesting addition Marco! Thanks!

Thank you!

cool

you are great !!!

Super!

Great function! Is it possible to call the returns of one of my portfolios in this function. It would be super useful to avoid stocks highly correlated stocks across portfolios.

Also, can this be used with ETFs?