Description
Cvxportfolio is a Python library for portfolio optimization and back-testing. It lets you try optimization policies for asset management and test them against your past performance with a market simulator. The library was written by Stanford University researchers together with BlackRock investment professionals, and its accompanying paper describes most of the models, accounting methods, naming conventions and assumptions it uses. The project runs daily example strategies from the development branch, committing target weights and initial holdings each day, and the code that runs them, including the cron script, is in the repository. It installs with pip, and Anaconda installs are also supported. Its main dependencies are CVXPY, which connects to numerical solvers, and Pandas, which connects to databases. The project does not require specific versions of these and says it tests against recent ones. Its test suite runs with python -m cvxportfolio.tests, and it is tested on Python 3.8 through 3.12 on major operating systems. In an offline environment, the suite can be run while ignoring the DownloadError from the few tests that use the internet. The library is aimed at quantitative researchers and students who want to build and back-test portfolio strategies in Python. The documentation has a manual, an API reference, examples and a contributing guide. Install it with pip install -U cvxportfolio.…
Highlights
- Portfolio optimization policies in Python
- Back-testing with a market simulator
- Daily example strategies published in the repository
- Installs with pip or Anaconda
- Tested on Python 3.8 to 3.12
Ratings & Reviews
No ratings yet
Be the first to rate Cvxportfolio.
People also visit
EigenLedger
An Open Source Portfolio Backtesting Engine for Everyone | 面向所有人的开源投资组合回测引擎
Cvxportfolio FAQ
What is Cvxportfolio?
A Python library for portfolio optimization and back-testing, with a market simulator for testing strategies on past performance.
Who wrote it?
Stanford University researchers together with BlackRock investment professionals, according to the documentation.
How do I install it?
Run pip install -U cvxportfolio. Anaconda installs are also supported.
Which Python versions are supported?
The project tests against Python 3.8, 3.9, 3.10, 3.11 and 3.12.
What are its main dependencies?
CVXPY for numerical solvers and Pandas for database interfacing. The project tests against recent versions of both.
How do I run the tests?
Run python -m cvxportfolio.tests. Offline, you can run the suite ignoring the DownloadError from tests that use the internet.
Is it open source?
Yes. The source and daily example strategies are in a public GitHub repository under cvxgrp.
What are the best Cvxportfolio alternatives?
Popular alternatives to Cvxportfolio include PyPortfolioOpt, Riskfolio-Lib and EigenLedger. See all Cvxportfolio alternatives


