azapy project
Financial Portfolio Optimization Algorithms
An open-source python library for everybody
Author: Mircea Marinescu
email: Mircea.Marinescu@outlook.com
Package installation: pip install azapy
A graphical user interface is provided by azapyGUI package.
Contents
A. Risk-based portfolio optimization algorithms
- mCVaR - mixture CVaR (Conditional Value at Risk)
- mSMCR - mixture SMCR (Second Moment Coherent Risk)
- mMAD - m-level MAD (Mean Absolute Deviation)
- mLSD - m-level LSD (Lower Semi-Deviation)
- mBTAD - mixture BTAD (Below Threshold Absolute Deviation)
- mBTSD - mixture BTSD (Below Threshold Semi-Deviation)
- GINI - Gini index (as in Corrado Gini statistician 1884-1965)
- SD - standard deviation
- MV - variance (as in mean-variance model)
- mEVaR - mixture EVaR (Entropic Value at Risk) (beta version)
For each class of portfolio the following optimization strategies are available
- Optimal-risk portfolio for targeted expected rate of return value
- Sharpe-optimal portfolio - maximization of generalized Sharpe ratio
- Sharpe-optimal portfolio - minimization of inverse generalized Sharpe ratio
- Minimum risk portfolio
- Optimal-risk portfolio for a fixed risk-aversion factor
- Optimal-risk portfolio with the same risk value as a benchmark portfolio (e.g., same as equal weighted portfolio)
- Optimal-diversified portfolio for targeted expected rate of return (minimization of inverse 1-D ratio) (beta version)
- Optimal-diversified portfolio for targeted expected rate of return (maximization of 1-D ratio) (beta version)
- Maximum diversified portfolio (beta version)
- Optimal-diversified portfolio with the same diversification factor as a benchmark portfolio (e.g., same as equal weighted portfolio) (beta version)
- Optimal-diversified portfolio with the same expected rate of return as a benchmark portfolio (e.g., same as equal weighted portfolio) (beta version)
B. "Naïve" portfolio strategies
- Constant weighted portfolio. A particular case is equal weighted portfolio.
- Inverse volatility portfolio (i.e., portfolio weights are proportional to the inverse of asset volatilities)
- Inverse variance portfolio (i.e., portfolio weights are proportional to the inverse of asset variances)
- Inverse drawdown portfolio (i.e., portfolio weights are proportional to the asset absolute value of maximum drawdowns over a predefined historical period)
C. Greedy portfolio optimization strategies
- Kelly's portfolio (as in John Larry Kelly Jr. scientist 1923-1965) - maximization of portfolio log returns
- Universal portfolio (Thomas M. Cover 1996) (beta version)
D. Market Selectors
- Dual Momentum Selector (beta version)
- Correlation Clustering Selector (beta version)
Utility functions:
-
Collect historical market data from various providers.
Supported providers:
- yahoo.com
- eodhistoricaldata.com
- alphavantage.co
- marketstack.com
-
Generate business calendars for all major exchanges across the world.
-
Generate rebalancing portfolio schedules.
-
Append a cash-like security to an existing market data object.
-
Update market data saved in a directory.
-
N-simplex random vectors generators.
Third-party packages used by azapy 1.2.6
- python 3.14.4
- pandas 3.0.2
- numpy 2.4.4
- scipy 1.17.1
- statsmodels 0.14.6
- matplotlib 3.10.8
- requests 2.31.1
- nbformat 5.10.4
- jinja2 3.1.6
- ecos 2.0.14
- cvxopt 1.3.3
- pandas_market_calendars 5.3.2
- ta 0.11.0
- yfinance 1.3.0
Metadata
Release files for azapy 1.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| azapy-1.2.6.tar.gz | 114.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| azapy-1.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 278.1 kB
Release files / azapy-1.2.6.tar.gz
| Download URL | azapy-1.2.6.tar.gz |
|---|---|
| Size | 114.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
26e803217a793e5492c9de0b0dbf822bf0c7da7b79a997240cc98d93c5f1ecda
|
|
BLAKE2b-256 checksum How to use checksums |
16641a04c28bec9b6c24b2b54abe6cac6e3bc94c5391d605b5245f712ecf80c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / azapy-1.2.6-py3-none-any.whl
| Download URL | azapy-1.2.6-py3-none-any.whl |
|---|---|
| Size | 163.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
13793ff3d12c3596f24166b1c5c8cccb7631a090c73134901ccfcb6433002a03
|
|
BLAKE2b-256 checksum How to use checksums |
ce157301e75931000f0c7f80e9ab2e649e2672a831177b47e4010b1922f9d04c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|