Skip to main content
Skip to main navigation
Call TradeStation 800.808.9336
Correlation analysis is about observing the interaction of various securities and markets. Since these relationships are dynamic, it is useful to measure them historically and to monitor them in real time. For example, this analysis may be useful in revealing which securities in a portfolio provide diversification and which may be duplicating unwanted risk. Here, two custom indicators are used to highlight inter-market relationships.
Pearson’s correlation coefficient between two variables is defined as the covariance of the two variables divided by the product of their standard deviations:
“In the world of finance, correlation is a statistical measure of how two securities move in relation to each other. Correlation is computed into what is known as the correlation coefficient, which ranges between -1 and +1. Perfect positive correlation (a correlation coefficient of +1) implies that as one security moves, either up or down, the other security will move in lockstep, in the same direction. Alternatively, perfect negative correlation means that if one security moves in either direction the security that is perfectly negatively correlated will move in the opposite direction. If the correlation is 0, the movements of the securities are said to have no correlation; they are completely random. In real life, perfectly correlated securities are rare; rather, you will find securities with some degree of correlation" (Investopedia 2012).
The first custom indicator presented in this paper is the “TSLabs: CoeffR indicator,” which graphically depicts Pearson’s product moment correlation coefficient R, also known as the “coefficient R.” Due to price variability among securities, it soon becomes apparent that the line tracking the coefficient R is quite volatile even when the length of the look-back period is large – for example, 120 days, or roughly six months of data. Therefore, it might be useful to use percentage moves instead of price moves. Using daily percentage moves instead of daily prices as inputs for the coefficient R function smoothes out the coefficient R line dramatically (see the blue histogram versus cyan line in Figure 1). Both methods have advantages and disadvantages that will be discussed shortly. The different inputs for the TSL CoefficientR indicator are described in Table 1.
The main advantage of using the price moves is that the CoeffR line will usually reflect a change in correlation faster than the coefficient R based on percentage moves, assuming the same look-back length. An example is provided below in Figure 2, where the euro currency and crude oil became highly positively correlated for many months in the beginning of 2007. Notice how the CoeffR_Price line (cyan line) increased sharply towards +1, while the CoeffR_Perc line (blue histogram) reflected an uncorrelated reading during the same period before finally increasing around the end of 2007. Therefore, depending on the application, it may be adequate to have a shorter look-back length for the CoeffR_Perc versus that for the CoeffR_Price, to identify correlation changes quicker.
While the point above may be a disadvantage for the CoeffR_Perc for some applications, it may be an advantage for other applications. For instance, when researching longer-term correlations among securities within a portfolio, it might be useful to use the correlation coefficient based on percentage moves, since the concern may not be short-lived correlation shifts, but rather sustainable relationships.
The ability to view the correlation between two securities across a large time frame is a definite benefit of the CoeffR indicator. However, when numerous securities are considered, a matrix form is preferred, especially when comparing current correlation coefficient values.
The second custom indicator presented in this paper is the “TSLabs: Correlation Matrix” indicator for RadarScreen®, which displays the coefficient R values for all of the two security combinations from the first column of symbols in a RadarScreen window (see Figure 3). Notice that the same securities are listed in the first column and in the first row. Notice also that the securities are listed in the same order. Thus, the Matrix includes a diagonal with perfect positive correlation values (R = 1), since those cells reflect the correlation of each security against itself. The Correlation Matrix in its current form is designed to include a total of 10 different symbols. If applicable, a benchmark for the different securities, such as SPY for stocks or sectors, may be used in the last row and in the last column for reference purposes.
The symbols used may be changed by changing the symbols in the first RadarScreen column (Symbol column) and changing the input symbols on the indicator’s Format Indicator - Inputs tab. However, the plot names containing the symbols are embedded in the EasyLanguage® (line 228 through 237) and will not change automatically. In addition, decreasing or increasing the number of symbols used in the indicator requires additional work in EasyLanguage.
The date for the different correlation coefficient values can be specified as an input and is displayed in the last column of the indicator in the RadarScreen window for reference purposes. One can monitor current values by typing “Today” as the input.
The coefficient R for each pair of securities may be based on price or percentage moves, as in the CoeffR indicator for charting; however, in this case, only one approach may be used at a time. The choice of method is determined by the CoeffR_Price_Or_Perc input (1 for correlation values based on price moves, 2 for correlation values based on percentage moves).
When using a large look-back length for the coefficient R values, it may be necessary to adjust the amount of data loaded into the RadarScreen window. To adjust the amount of data, specify the number of bars to load on the General tab of the Format Indicator dialog. The field is titled, “Load additional data for accumulative calculations.” Notice that the field needs to be checked in order to edit the additional bars to load.
The different inputs for the TSL CoefficientR indicator are described in Table 2.
The main advantage of using the Correlation Matrix is the ability to view coefficient R values for a large number of symbols in the same window as of a specified date. In Figure 3, the coefficient R values are calculated as of May 6, 2010, which was the date of the 2010 “Flash Crash.” Changing the specified date in the inputs tab around this particular day reveals dramatic shifts in correlation. For instance, Financials (XLF) and Utilities (XLU) had a coefficient R value of 0.10 on May 4, 2010 (price-based coefficient R and look-back length of 21), and the value jumped to 0.91 by May 20, 2010, which is to say that the pair went from being uncorrelated to highly correlated very rapidly. Other sectors had similar shifts in correlation during the same time period (see Figure 4).
The previous example highlights the fact that correlations can change rather quickly under special circumstances. During normal market conditions, however, correlation analysis usually reveals which securities provide diversification, or duplicate risk, on a consistent basis. For instance, an equity investor may be surprised to see how correlated certain equities are in his or her portfolio. In such a case, a low level of diversification is achieved within the equity allocation and the investor may want to rethink current holdings. Adding uncorrelated equities could generate risk-reducing benefits. The idea here is that the positive performance of some positions will counter the negative performance of other positions. Additionally, pairs of securities that are negatively correlated may further reduce risk. Pairs trading can take many forms and this would be just one possible approach. Also keep in mind that, in practice, negatively correlated equities are hard to find and other asset classes may need to be considered, which brings us to the next point.
The Correlation Matrix can include securities of any type. The process to update the securities is outlined above. The Correlation Matrix in Figure 5 includes the main forex pairs as of March 15, 2012. In this particular case, the “CoeffR_Price_Or_Perc” input is set to 2 for coefficient R values based on percentage moves and the look-back length is set to 120. By using these settings, notice that the EURGBP is uncorrelated to the GBPUSD, while the EURUSD has a nearly perfect positive correlation with the USDCHF. Changing to coefficient R values based on price moves and/or changing the look-back length would affect all values displayed by the Correlation Matrix indicator. A shorter look-back length would, for example, capture the more recent correlation, while de-emphasizing the historical relationship.
Correlations between securities are often mistakenly assumed to hold during different market conditions. Certain securities can at times be highly positively or negatively correlated for only a season. Some of these relationships tend to be cyclical for some securities, such as @CL versus EURUSD. Other relationships tend to persist over time, such as the Dollar index versus the 3-Month UST/3-Month Euro implied differential spread. Once analysis has been performed for a particular relationship, different predictions may be made, with probabilities, as to how long a relationship may be expected to hold or how long divergence is expected to continue before positive or negative correlation resumes. These findings can then serve as grounds for mean-reversion as well as trend-following strategies.
Investopedia. Correlation. March 21, 2012. http://www.investopedia.com/dictionary/TermDefinitionPrintable.aspx?url=/terms/c/correlation.asp (accessed March 21, 2012).
To use the files provided with this issue of Analysis Concepts:
Questions or comments? Contact us at TSLabs@TradeStation.com
Call a TradeStation Specialist 800.808.9336
No offer or solicitation to buy or sell securities, securities derivative, futures products or off-exchange foreign currency (forex) transactions of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given or in any manner endorsed by any TradeStation affiliate and the information made available on this Website is not an offer or solicitation of any kind in any jurisdiction where any TradeStation affiliate is not authorized to do business, including but not limited to Japan.
Past performance, whether actual or indicated by historical tests of strategies, is no guarantee of future performance or success. There is a possibility that you may sustain a loss equal to or greater than your entire investment regardless of which asset class you trade (equities, options futures or forex); therefore, you should not invest or risk money that you cannot afford to lose. Options trading is not suitable for all investors. Your account application to trade options will be considered and approved or disapproved based on all relevant factors, including your trading experience. Please click here to view the document titled Characteristics and Risks of Standardized Options. Before trading any asset class, customers must read the relevant risk disclosure statements on our Other Information page. System access and trade placement and execution may be delayed or fail due to market volatility and volume, quote delays, system and software errors, Internet traffic, outages and other factors.
TradeStation Group, Inc. Affiliates: All proprietary technology in TradeStation is owned by TradeStation Technologies, Inc. Equities, equities options, and commodity futures products and services are offered by TradeStation Securities, Inc. (Member NYSE, FINRA, NFA and SIPC). TradeStation Securities, Inc.’s SIPC coverage is available only for equities and equities options accounts. Forex products and services are offered by the TradeStation Forex divisions of IBFX, Inc. (Member NFA) and IBFX Australia Pty Ltd, ABN 84 142 210 179, holder of AFSL #363972.
Copyright © 2001-2014 TradeStation Group, Inc.