I have a portfolio of stocks and all I want to do is to make sure that I'm not trading one big position, so I would like to monitor some type of metric that gives me a rough idea of what the overall correlation in the portfolio is and how it is changing day to day thru movement in prices. I want to get it down to one number a day, but I'm not sure how to do it. let's say I have three stocks a,b,c
. Do I just take the correlation between a
and b
, b
and c
, a
and c
, then average it? What is the correct way to do it?
Would it be possible to give a simple example? Let's say a,b,c stocks and the weights are 20%,30%,50% respectively. The 3 day daily returns are
day a b c
1 0% 2% 2%
2 1% -1% 0%
3 2% 1% 0%
How do I apply your formula?
And also just curious is there a package in python that does these calculation for you? I imagine I'm asking a pretty standard question, one would think it is a pre-package solution in a library somewhere. Would pandas
have something?