cvxgrp / cvxportfolio

Portfolio optimization and back-testing.
https://www.cvxportfolio.com
GNU General Public License v3.0
969 stars 255 forks source link

questions / thoughts on examples folder #88

Open quant5 opened 1 year ago

quant5 commented 1 year ago

I made a PR with a small refactor to two of the examples. https://github.com/cvxgrp/cvxportfolio/pull/87

I have some questions / thoughts:

enzbus commented 1 year ago

Ok you're right, I was experimenting with the examples when working on the covariance forecast, it scales nicely to hundreds of names. (The data doesn't take much space BTW, each stock takes 500k-1Mb, so less than 300Mb in total). The multiperiod example shows the effect of imposing constraints at time (if you know ahead of time that you have to be all cash on a given day, it plans and optimizes on tcost). This also showcases some new api elements (it wasn't possible in 0.0.X, now the policies in backtest are aware of the trading calendar). If you want you could also help me translate the old examples (in https://github.com/cvxgrp/cvxportfolio/tree/0.0.X ) for the new API. They should become much more terse, one of my goals has been to move logic that was built there into the library itself.

quant5 commented 1 year ago

Sounds great - I'll take a crack at (1) making new examples more user-friendly and explanatory and (2) refactoring old examples.