Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Need help with correlation [Finance]
2 points by astroguy on Nov 27, 2010 | hide | past | favorite | 7 comments
This is the map of the market. http://www.smartmoney.com/map-of-the-market/.

If you look at the map you will notice 11 key areas: Health care, Consumer Cyclicals, Financial Technology, Energy, Capital Goods, Telecom, Utilities, Basic Materials, Transport and Consumer Staples.

Each key area has certain number of core companies. How do I find the correlation between those areas?

[If we have two stocks S and T whose correlation has to be find, then cor(S,T) = sigma (( S(i) - SA) (T(i) - TA)) / (sigmassigmatn)

S(i) & T(i) are closing prices of the stock on the ith day, SA & TA are the mean prices of the stocks, sigmas = standard deviation of S, sigmat = standard deviation of T and n is the number of the days over which the correlation is to be found - Grabbed from a research paper]

Can above info be extended to find the correlation between those 11 key areas? If so, how?

Thank you for your thoughts!



Easy way: Find ETFs representing each of those core areas. Calculate the correlation coefficient between any of these pairs. You should be able to do this in any programming language, or with tools like eSignal or Tradestation if that's your cup of tea. You can have fun looking at correlation with other pairs in various markets if you think about it.

Edit: What are you looking to do with the correlation? As a technical indicator, it can be interesting to see when markets diverge/converge in price. Is this what you're after?


Yep, exactly! Any thoughts on opposing this approach?


It can be a good approach. Make sure you have a good source of historic price data to come up with the best strategies.


I was thinking to grab the data either from Yahoo finance or Google finance. If I remember right, it allows me to get data from past 5 years only. Do you have recommendation for any other resource?


Yahoo and Google are your best bets for historical prices. Just use the adjusted closing price (not the open or unadjusted prices).

Also, what you call a key area is referred to as a "sector" in investing. There are many ETF managers that try to track the various sectors, though your easiest bet might be the Sector SPDRs. Their webpage already has a correlation tool if you just want to use theirs:

http://www.sectorspdr.com/correlation/

Simply enter one of their ETFs (eg. "XLF") and look at the correlation of the other Sector SPDRs.


Thank you for the link. From your experience did you notice any immediate correlation between the sectors or any time delay? If there is some time delay, it might be a key feature to notice for short term trading, sounds right?


Um, what you're referring to is a form of high-frequency trading. For that you'll need (1) a direct connection to the exchange, and possibly even co-location; (2) historical tick data for backtesting; and (3) the hardware and software capable of executing the logic. The kinds of time-sensitive arbitrage opportunities you're hinting at take a TON of skill and start-up capital to perform.

Basically, if you haven't done this kind of stuff before, this not the type of strategy you should start with.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: