Correlation Coefficient

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
technical_indicators:correlation_coeffici [2019/06/24 19:38]
127.0.0.1 external edit
technical_indicators:correlation_coeffici [2023/02/06 16:51] (current)
jayanthi [Using With StockChartsACP]
Line 1: Line 1:
 ====== Correlation Coefficient ====== ====== Correlation Coefficient ======
  
-===== Introduction =====+===== Introduction ​to Correlation Coefficient ​=====
  
 The Correlation Coefficient is a statistical measure that reflects the correlation between two securities. In other words, this statistic tells us how closely one security is related to the other. The Correlation Coefficient is positive when both securities move in the same direction (up or down) and negative when the two securities move in opposite directions. Determining the relationship between two securities is useful for analyzing intermarket relationships,​ sector-stock relationships and sector-market relationships. This indicator can also help investors diversify by identifying securities with a low or negative correlation to the stock market. ​ The Correlation Coefficient is a statistical measure that reflects the correlation between two securities. In other words, this statistic tells us how closely one security is related to the other. The Correlation Coefficient is positive when both securities move in the same direction (up or down) and negative when the two securities move in opposite directions. Determining the relationship between two securities is useful for analyzing intermarket relationships,​ sector-stock relationships and sector-market relationships. This indicator can also help investors diversify by identifying securities with a low or negative correlation to the stock market. ​
  
-===== Calculation ​=====+===== How Correlation Coefficient Is Calculated ​=====
  
-The calculation for the Correlation Coefficient is rather ​complicated,​ so feel free to skip this section. We will simply ​look at the basics to see some of the method ​behind the madness. This indicator is right at the heart of classical statistics. The first step is to select two securities. In this example, we will be using Intel (INTC) and the Nasdaq 100 ETF (QQQ). Namely, we want to see the degree of correlation between Intel and QQQ. The Excel table below lays out the groundwork. ​+The calculation for the Correlation Coefficient is complicated,​ so feel free to skip this section. We will look at the basics to see some of the methods ​behind the madness. This indicator is right at the heart of classical statistics. The first step is to select two securities. In this example, we will be using Intel (INTC) and the Nasdaq 100 ETF (QQQ). Namely, we want to see the degree of correlation between Intel and QQQ. The Excel table below lays out the groundwork. ​
  
 {{:​technical_indicators:​correlation_coeffici:​ccoe-01-excel.png|Correlation Coefficient ​ -  Excel Example}} {{:​technical_indicators:​correlation_coeffici:​ccoe-01-excel.png|Correlation Coefficient ​ -  Excel Example}}
Line 22: Line 22:
 Here's {{:​technical_indicators:​correlation_coeffici:​cs-corrcoef.xls?​linkonly|an Excel Spreadsheet}} that shows the Correlation Coefficient in action. Some numbers may differ slightly due to rounding issues. ​ Here's {{:​technical_indicators:​correlation_coeffici:​cs-corrcoef.xls?​linkonly|an Excel Spreadsheet}} that shows the Correlation Coefficient in action. Some numbers may differ slightly due to rounding issues. ​
  
-===== Interpretation ​=====+===== Interpreting Correlation Coefficient ​=====
  
-The Correlation Coefficient ​oscillates between -1 and +1. It is not a momentum oscillator, however. Instead, it moves from periods of positive correlation to periods of negative correlation. +1 is considered perfect positive correlation,​ which is rare. Anything between 0 and +1 indicates that two securities move in the same direction. The degree of positive correlation is likely to vary over time. Oil stocks and oil are positively correlated most of the time. The example below shows the Energy SPDR (XLE) with Spot Light Crude ($WTIC). Unsurprisingly,​ the 20-day Correlation Coefficient remains largely positive with regular forays above +.75. There is clearly a positive relationship between these two securities. In general, anything above .50 shows a strong positive correlation. ​+The correlation coefficient ​oscillates between -1 and +1. It is not a momentum oscillator, however. Instead, it moves from periods of positive correlation to periods of negative correlation. +1 is considered perfect positive correlation,​ which is rare. Anything between 0 and +1 indicates that two securities move in the same direction. The degree of positive correlation is likely to vary over time. Oil stocks and oil are positively correlated most of the time. The example below shows the Energy SPDR (XLE) with Spot Light Crude ($WTIC). Unsurprisingly,​ the 20-day Correlation Coefficient remains largely positive with regular forays above +.75. There is clearly a positive relationship between these two securities. In general, anything above .50 shows a strong positive correlation. ​
  
 {{:​technical_indicators:​correlation_coeffici:​ccoe-03-xlewtic.png|Correlation Coefficient ​ -  Oil and Oil Stocks}} {{:​technical_indicators:​correlation_coeffici:​ccoe-03-xlewtic.png|Correlation Coefficient ​ -  Oil and Oil Stocks}}
Line 32: Line 32:
 {{:​technical_indicators:​correlation_coeffici:​ccoe-04-goldusd.png|Correlation Coefficient ​ -  Gold and Dollar}} {{:​technical_indicators:​correlation_coeffici:​ccoe-04-goldusd.png|Correlation Coefficient ​ -  Gold and Dollar}}
  
-===== Diversification ===== +===== Diversification: Investing in Non-correlated Securities ​===== 
  
-The Correlation Coefficient ​can be used to identify non-correlated securities, which is important in developing a diversified portfolio. Unsurprisingly,​ the nine S&P sectors are mostly positively correlated with the S&P 500. However, some are more positively correlated than others. For example, the Technology ETF (XLK) and the Consumer Discretionary SPDR (XLY) have a strong positive correlation with the S&P 500 over the last three years. The Correlation Coefficients ​below are based on 50 days. The consumer discretionary ​sector dipped below .50 only once in the last three years. The technology ​sector never dipped below .50 as techs remained strongly correlated to the market. In contrast, the Correlation Coefficient ​for the consumer staples ​sector dipped below .50 a few times and the Correlation Coefficient ​for the utilities ​sector even dipped below zero twice. This indicator shows us that the consumer staples ​and utilities sectors ​are less correlated to the S&P 500 than the consumer discretionary ​and technology ​sectors. ​+The correlation coefficient ​can be used to identify non-correlated securities, which is important in developing a diversified portfolio. Unsurprisingly,​ the nine S&P sectors are mostly positively correlated with the S&P 500. However, some are more positively correlated than others. For example, the Technology ETF (XLK) and Consumer Discretionary SPDR (XLY) have a strong positive correlation with the S&P 500. The correlation coefficient examples ​below are based on 50 days. The Consumer Discretionary ​sector dipped below 0.50 only once in the last three years. The Technology ​sector never dipped below 0.50 as tech stocks ​remained strongly correlated to the market. In contrast, the correlation coefficient ​for the Consumer Staples ​sector dipped below 0.50 a few times and the correlation coefficient ​for the Utilities ​sector even dipped below zero twice. This indicator shows us that Consumer Staples ​and Utilities ​are less correlated to the S&P 500 than the Consumer Discretionary ​and Technology ​sectors. ​
  
 {{:​technical_indicators:​correlation_coeffici:​ccoe-05-sectors.png|Correlation Coefficient - Sectors}} {{:​technical_indicators:​correlation_coeffici:​ccoe-05-sectors.png|Correlation Coefficient - Sectors}}
  
-In order to truly diversify from stocks, it is often necessary to look outside of the stock market. The chart below shows four ETFs that have many periods of negative correlation with the stock market (SPY). Notice how the Correlation Coefficients ​dip below zero numerous times. In this example, ​I am also using the 50-day ​Correlation Coefficient. The 20+ year Bond ETF (TLT) represents bonds, which are negatively correlated with stocks most of the time. Gold (red) moves between periods of positive and negative correlation. On the whole, it has been more positively correlated than negative ​the last three years. The Yen Trust (green) appears to split its time between periods of positive and negative correlation. Surprisingly,​ the US Dollar Fund (UUP) shows a propensity to be negatively correlated with the stock market.  ​+To truly diversify from stocks, it is often necessary to look outside of the stock market. The chart below shows four exchange-traded funds (ETFsthat have many periods of negative correlation with the stock market (using SPY as a proxy). Notice how the correlation coefficients ​dip below zero numerous times. In this example, the 50-day ​correlation coefficient is used. The 20+ year Bond ETF (TLT) represents bonds, which are negatively correlated with stocks most of the time. Gold (red) moves between periods of positive and negative correlation. On the whole, it has been more positively correlated than negative. The Yen Trust (green) appears to split its time between periods of positive and negative correlation. Surprisingly,​ the US Dollar Fund (UUP) shows a propensity to be negatively correlated with the stock market.  ​
  
 {{:​technical_indicators:​correlation_coeffici:​ccoe-06-diversify.png|Correlation Coefficient ​ -  Other Assets}} {{:​technical_indicators:​correlation_coeffici:​ccoe-06-diversify.png|Correlation Coefficient ​ -  Other Assets}}
Line 44: Line 44:
 ===== Conclusion ===== ===== Conclusion =====
  
-The Correlation Coefficient ​tells us the relationship between two securities. Over a given time period, the two securities move together when the Correlation Coefficient is positive. Conversely, the two securities move in opposite directions when the Correlation Coefficient is negative. The examples above show 20-day and 50-day Correlation Coefficients. Longer-term investors may use 150 or even 250 days (one year) for smoother lines that reflect longer-term relationships.+The correlation coefficient ​tells us the relationship between two securities. Over a given time period, the two securities move together when the Correlation Coefficient is positive. Conversely, the two securities move in opposite directions when the Correlation Coefficient is negative. The examples above show 20-day and 50-day Correlation Coefficients. Longer-term investors may use 150 or even 250 days (one year) for smoother lines that reflect longer-term relationships.
  
-===== Using with SharpCharts ===== +===== Correlation Coefficient:​ How to Find ===== 
 +The correlation coefficient is available as an indicator in SharpCharts ​and StockChartsACP. 
 +==== Using With SharpCharts ​==== 
  
-The Correlation Coefficient ​is available in SharpCharts under "​indicators."​ First, create a chart with the base security ​entered ​in the symbol box at the top of the chart (INTC). ​Second, select ​Correlation as an indicator in the drop-down menu. Third, enter the symbol for the other security and the timeframe in the parameters box ($SPX,​10). ​These two are separated by a comma. The example below shows Intel in the main window with the 10-day ​Correlation Coefficient ​in the indicator window. This shows how Intel correlates ​to the S&P 500. Alsonotice that the S&P 500 price plot (red dashed) is placed behind the Intel price plot for comparison. [[https://​stockcharts.com/​h-sc/​ui?​s=INTC&​p=D&​b=5&​g=0&​id=p82568512106|Click here]] for a live chart with the Correlation Coefficient+The correlation coefficient ​is available in SharpCharts under "​indicators."​ First, ​you'll need to create a chart with the base security.          
 + 
 +  - Enter the symbol ​in the symbol box at the top of the chart (INTC). ​ 
 +  - Select ​Correlation as an indicator in the drop-down menu.  
 +  - Enter the symbol for the other security and the timeframe in the parameters box ($SPX,​10). ​The two are separated by a comma. ​ 
 + 
 +The example below shows Intel in the main window with the 10-day ​correlation coefficient ​in the indicator window. This shows how Intel correlates ​with the S&P 500. Note, for comparison, the S&P 500 price plot (red dashed) is placed behind the Intel price plot.  [[https://​stockcharts.com/​h-sc/​ui?​s=INTC&​p=D&​b=5&​g=0&​id=p82568512106|Click here]] for a live chart with the correlation coefficient
  
 {{:​technical_indicators:​correlation_coeffici:​ccoe-07-intcshch.png|Correlation Coefficient ​ -  Intel SharpCharts}} {{:​technical_indicators:​correlation_coeffici:​ccoe-07-intcshch.png|Correlation Coefficient ​ -  Intel SharpCharts}}
Line 54: Line 62:
 {{:​technical_indicators:​correlation_coeffici:​ccoe-08-shch.png|Correlation Coefficient ​ -  SharpCharts}} {{:​technical_indicators:​correlation_coeffici:​ccoe-08-shch.png|Correlation Coefficient ​ -  SharpCharts}}
  
 +==== Using With StockChartsACP ====
 +
 +The correlation coefficient is included in StockChartsACP in the Standard Indicators list. 
 +
 +{{ :​technical_indicators:​correlation-coeff-acp.jpg |}}
 +
 +  - Pull up a chart by entering the symbol in the symbol box.
 +  - Select Correlation from the indicators listed in the menu on the left
 +  - Select the settings icon next to the indicator name to change the parameters. The Benchmark Symbol will be the symbol you entered. Enter the symbol for comparison in the Symbol box, select the number of periods for the indicator.
 ===== Suggested Scans ===== ===== Suggested Scans =====
  
Line 64: Line 81:
 </​code>​ </​code>​
  
-For more details on the syntax to use for Correlation scans, please see our [[docs>scans:​indicators#​correlation_coefficient|Scanning Indicator Reference]] in the Support Center.+For more details on the syntax to use for Correlation scans, please see our [[https://​support.stockcharts.com/​doku.php?​id=scans:​indicators#​correlation_coefficient|Scanning Indicator Reference]] in the Support Center.