Calculating the correlation between two stocks?

Discussion in 'Stocks' started by frank99, Oct 18, 2007.

  1. frank99


    Does anyone know the formula for calculating the relationship between two instruments such as:

    OIH and XLE
    Gold and the Dollar

    Or even, GBP/JPY and the S&P 500.

    I need to know the formula since I would like to calculate regularly. I'm looking for something that tells me how closely two instruments move together depending on the time frame.


  2. dont


    do yourself a favor and look up co-integration. There are some free calculators on the net.

    Its a better measure of the co-movement of stocks than correlation.

    Correlation looks at the relationship between the % returns on two stocks.
    Co-integration the movement between the prices.
  3. frank99


    Thanks! I'll check out your recommendations.

  4. Just download the historic values into excel for the securities you want to calculate correlation. Then use the "Correlation Coefficient" formula from the statistics to calculate the relationship.

    A value of 1 means perfect positive correlation, 0 means no correlation and -1 means perfect opposite correlation. Anything in between gives you the "relative" correlation.
  5. frank99


    This is an excellent idea!

    Do you know how to get historic data in a format that I can import into Excel?

    Is there a website that provides this for free?




    go to a stock and compare to another symbol...