Skip to main content

Open-source Python module for portfolio management with a plethora of portfolio schemes, stochastic backtesting and comprehensive metrics.

Project description

$\Theta \text{PES}$

An open-source Python library for advanced portfolio optimization and backtesting.

Overview

OPES provides a plethora of quantitative portfolio optimizers with a comprehensive backtesting engine. Test strategies against historical data with configurable slippage costs.

Key Features

Porfolio Objectives

Utility Theory

  • Quadratic Utility
  • Constant Relative Risk Aversion
  • Constant Absolute Risk Aversion
  • Hyperbolic Absolute Risk Aversion
  • Kelly Criterion and Fractions

Markowitz Paradigm

  • Maximum Mean
  • Minimum Variance
  • Mean Variance
  • Maximum Sharpe

Principled Heuristics

  • 1/N
  • Risk Parity
  • Inverse Volatility
  • Softmax Mean
  • Maximum Diversification
  • Return Entropy Portfolio Optimization
  • Discrete Entropy Portfolio Optimization

Risk Measures

  • Conditional Value at Risk
  • Mean-CVaR
  • Entropic Value at Risk
  • Mean-EVaR
  • Entropic Risk Metric

Online Learning

  • BCRP with weight regularization (FTL/FTRL support)
  • Exponential Gradient

Distributionally Robust Optimization (Kullback-Leibler)

  • Distributionally Robust Maximum Mean
  • Distributionally Robust Kelly and Fractions

Slippage Models

  • Constant
  • Gamma
  • Lognormal
  • Inverse Gaussian
  • Compound Poisson-Lognormal

Regularization Schemes

  • L1
  • L2
  • L $\infty$
  • Entropy
  • Weight Variance
  • Mean Pairwise Absolute Deviation

Backtest Metrics

  • Sharpe Ratio
  • Sortino Ratio
  • Volatility
  • Average Return
  • Total Return
  • CAGR
  • Maximum Drawdown
  • Calmar Ratio
  • Value at Risk 95
  • Conditional Value at Risk 95
  • Skew
  • Kurtosis
  • Omega Ratio

Portfolio Metrics

  • Tickers
  • Weights
  • Portfolio Entropy
  • Herfindahl Index
  • Gini Coefficient
  • Absolute Maximum Weight

Installation

pip install opes

Disclaimer

The information provided by OPES is for educational, research and informational purposes only. It is not intended as financial, investment or legal advice. Users should conduct their own due diligence and consult with licensed financial professionals before making any investment decisions. OPES and its contributors are not liable for any financial losses or decisions made based on this content. Past performance is not indicative of future results.

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

opes-0.4.1.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opes-0.4.1-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file opes-0.4.1.tar.gz.

File metadata

  • Download URL: opes-0.4.1.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for opes-0.4.1.tar.gz
Algorithm Hash digest
SHA256 8f73fff261a1be4eaaa3f5cac7dad3bf052e7bab6102a3e2ef5e10d3ecb7fbd9
MD5 5395529f478c0cf265898c9556a5f226
BLAKE2b-256 9adaf078744df0bb3247bb04472bd10eeef3e2aef8225ca1ab97f82e03715be1

See more details on using hashes here.

File details

Details for the file opes-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: opes-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for opes-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 168f17911c48246b5e7f95b8113c83ba9898cb80263d8ece5db7064d01f00cb9
MD5 70e38eba3877465986b4cf65b9583051
BLAKE2b-256 2271bb1361395beb37731a939f16631105ae6a92f77166a845618aa146ae2bd4

See more details on using hashes here.

Supported by

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