Portfolio optimisation for systematic trading comes down to one question: given expected returns and a covariance matrix, what weights maximise risk-adjusted return?
Today we are going to show how to solve this using CVXPY, a Python library for convex optimisation. CVXPY works well for small problems but become slow at scale; they are not optimised for large-scale quadratic programs. In future articles, we will look at MOSEK, a commercial solver that runs 10-100x faster on portfolios with thousands of signals/positions. Later we will look to roll our own optimizers which are themselves 100x faster than Mosek.
Outstanding walkthrough of signal-level optimization. The key insight about MVO working better on signals than instruments is underappreciated - most implementations get stuck trying to forecast instrument returns directly and end up with garbage in garbage out. Learned this the hard way at a previous shop where our MVO kept suggesting wild concentrated bets untill we realized the estimation error on individual equities was drowning the covariance structure. Running MVO at the signal layer sidesteps that entirely.
If you do MVO on signal space how would you add constraints on bounds of individual asset, and constraint such as lambda * |w optimal - current w | ? Is there a clean way or do you again have to map the problem back into another optimization problem.
i have usually been combining alphas before the optimization routine to come with a unified forecast for each asset and run optimization on the instrument with t.cost and risk model.
Thanks for the thoughtful and comprehensive write‑up. I spent an hour or so this morning going through it. Gamma seems a little hard to get my head around though, I'm not sure what exactly I would choose for my own portfolio.
Outstanding walkthrough of signal-level optimization. The key insight about MVO working better on signals than instruments is underappreciated - most implementations get stuck trying to forecast instrument returns directly and end up with garbage in garbage out. Learned this the hard way at a previous shop where our MVO kept suggesting wild concentrated bets untill we realized the estimation error on individual equities was drowning the covariance structure. Running MVO at the signal layer sidesteps that entirely.
If you do MVO on signal space how would you add constraints on bounds of individual asset, and constraint such as lambda * |w optimal - current w | ? Is there a clean way or do you again have to map the problem back into another optimization problem.
i have usually been combining alphas before the optimization routine to come with a unified forecast for each asset and run optimization on the instrument with t.cost and risk model.
Nice post and thanks for share. I' am really curious about how to use signals. Could you explain in more details in a future post?
Thanks for the thoughtful and comprehensive write‑up. I spent an hour or so this morning going through it. Gamma seems a little hard to get my head around though, I'm not sure what exactly I would choose for my own portfolio.
0.5 is a good start!