Marigold/universal-portfolios ? reverse-engineered prompt

Reverse engineered prompt

Build me a Python library for comparing online portfolio selection strategies, with a simple common interface for running different algorithms on the same market data.

I want it to include a bunch of classic portfolio rules from the literature, like buy and hold, constant rebalanced portfolios, universal portfolio, mean reversion, Markowitz style methods, and a few pattern matching approaches. It should be easy to feed in price data, get portfolio weights at each time step, and then calculate final wealth and a few basic performance stats.

Please also include a couple of notebooks that explain how to use it and show examples on built in datasets. If you can, add a small example that highlights why backtests can be misleading because of survivor only data and trading costs. Use the repo’s existing tests and make the code clean enough that the different strategies all plug into the same flow. If you need current package docs for anything, look them up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab