Correlation calculations

The Correlation Grid is available for Enterprise Services clients which allows you to calculate the correlations between each component of a list, but what if you just wanted to show the correlation of a list of symbols against an index or another security? This can be done using the Correlation function CRL().

Here’s an example of the US Sector ETFs against the US Dollar Index $DXY over the last 20 trading days, using this script in a Watchlist column:

C1 = CLOSE();
CRL(C1, S1, BARS=20)

Utilities ($XLU) is currently most positively correlated to the $DXY, with Materials ($XLB) the most negatively correlated. Real Estate ($XLRE) is the leasr correlated: