Hi every one,
I'm new here, and I wanted to share with you the results of some quick experiments I've been doing with the classical Markowitz optimization technique. I based my code on these notebooks:
https://blog.quantopian.com/markowitz-portfolio-optimization-2/
https://www.quantopian.com/posts/the-efficient-frontier-markowitz-portfolio-optimization-in-python-using-cvxopt
I just made a small modification to make sure the algorithm maximizes the sharpe ratio (the original code somehow maximized the return).
It turns out, the original Markowitz is incredible prone to survivorship bias. I ran the simulation from mid 2006 to 2016. When I use the current top 25 stocks of the SP500 (discarding those that did not exist back then, like FB or so), the algorithm performs, let's say -acceptable- it doesn't beat the benchmark or anything, but it follows it closely, even with though I rebalance daily and with the default transactions costs.
(See attached backtest)
But as soon as I include the next 20 stocks of the SP500, the algorithm plunges. The performance is so terrible at first I thought it could be some code bug, so double checked everything, but so far I think everything checks.
Still, I'd like a second opinion on this. If it is indeed a case of survivorship bias, it's pretty amazing how a small change in the universe of stocks can dramatically change the results of Markowitz technique. I mean, it's not like I'm comparing the top10 vs the bottom10 or something, it's just adding a few more good stocks =S