Skip to main content

...

Project description

Cvxportfolio

CVXportfolio on PyPI Downloads Apache 2.0 License Code style: black Documentation Status Binder

Cvxportfolio is currently under development. We will freeze the user interface by end of 2023Q2 and release the first stable version by end of 2023Q3.

cvxportfolio is a python library for portfolio optimization and simulation, based on the paper Multi-Period Trading via Convex Optimization. It is written in Python, its major dependencies are cvxpy and pandas. The documentation of the package is at cvxportfolio.readthedocs.io.

Installation

pip install cvxportfolio

Testing

To test it locally set up the development environment with poetry (you will need to install it first) and run pytest.

git clone https://github.com/cvxgrp/cvxportfolio.git
cd cvxportfolio
poetry install
poetry run pytest --cov

Examples

You can see basic usage of the package in the example notebooks. Currently we are working on simplifying the user interface and these may change.

To run them clone the repository, create the environment and the cvxportfolio kernel, and then start jupyter.

git clone https://github.com/cvxgrp/cvxportfolio.git
cd cvxportfolio
poetry install
bash create_kernel.sh
cd examples
poetry run jupyter notebook

The ones that run without isses (as of 2023-04-11) are HelloWorld and MultiPeriodTCostOptimization.

The other example notebooks were used to develop the plots and results in the paper. We are keeping them for historical record but they don't currently run. We are doing our best to restore them.

Citing

If you wish to cite CVXPortfolio, please use:

@article{BBDKKNS:17,
    author       = {S. Boyd and E. Busseti and S. Diamond and R. Kahn and K. Koh and P. Nystrup and J. Speth},
    title        = {Multi-Period Trading via Convex Optimization},
    journal      = {Foundations and Trends in Optimization},
    year         = {2017},
    month        = {August},
    volume       = {3},
    number       = {1},
    pages        = {1--76},
    publisher    = {Now Publishers},
    url          = {http://stanford.edu/~boyd/papers/cvx_portfolio.html},
}

License

Cvxportfolio is licensed under the Apache 2.0 permissive open source license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cvxportfolio-0.1.1.tar.gz (19.6 kB view hashes)

Uploaded Source

Built Distribution

cvxportfolio-0.1.1-py3-none-any.whl (26.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page