Financial Portfolio Optimization Algorithms
Project description
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
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) (alpha 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) (alpha version)
D. Market Selectors
- Dual Momentum Selector (alpha version)
- Correlation Clustering Selector (alpha version)
Utility functions:
-
Collect historical market data from various providers.
Supported providers:
- yahoo.com
- eodhistoricaldata.com
- alphavantage.co
- marketstack.com
-
Generate business calendars. At this point only NYSE business calendar is implemented.
-
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.1
- python 3.11.2
- pandas 2.1.4
- numpy 1.26.2
- scipy 1.11.4
- statsmodels 0.14.0
- matplotlib 3.8.0
- plotly 5.9.0
- requests 2.31.0
- pandas_market_calendars 4.3.2
- ecos 2.0.12
- cvxopt 1.3.2
- ta 0.11.0
- yfinance 0.2.33
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
azapy-1.2.2.tar.gz
(110.1 kB
view details)
Built Distribution
azapy-1.2.2-py3-none-any.whl
(157.2 kB
view details)
File details
Details for the file azapy-1.2.2.tar.gz
.
File metadata
- Download URL: azapy-1.2.2.tar.gz
- Upload date:
- Size: 110.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6c01fd7d16fa2d84b77a334e91a46053c37711f03fc5ef2b758b297627c2dc0 |
|
MD5 | a0947d226c56613095f78d857b2470ac |
|
BLAKE2b-256 | b2195fc0bdf3b5450e61d366cb90d3d36bc15fc8d485cdc10ca8b8261dd7162a |
File details
Details for the file azapy-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: azapy-1.2.2-py3-none-any.whl
- Upload date:
- Size: 157.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 374420b482faca2c2b257ace02169dfdf3b8b1766115eb742549b710c83ed9e6 |
|
MD5 | 3f496737233e0a6d7e3b8159951023ae |
|
BLAKE2b-256 | 19036518d34ec619e0e0a55c18e7e29648cc0e1acef95cf1b975cb647e6d2097 |