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 risk-based optimization class the following 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
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.
The pollowing third-party packages were used with azapy 1.1.1
- python 3.11.2
- pandas 1.5.3
- numpy 1.23.5
- scipy 1.10.0
- statsmodels 0.13.5
- matplotlib 3.7.1
- plotly 5.9.0
- requests 2.28.1
- pandas_market_calendars 4.1.4
- ecos 2.0.12
- cvxopt 1.3.0.1
- ta 0.10.2
- yfinance 0.2.14
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
Built Distribution
File details
Details for the file azapy-1.1.1.tar.gz
.
File metadata
- Download URL: azapy-1.1.1.tar.gz
- Upload date:
- Size: 89.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4cd9eeab19e0b86db1712036195af0d237dbf5be36790ef9baf05e14cfd0205 |
|
MD5 | 12926270d34c8c371c4449e5e8fbe496 |
|
BLAKE2b-256 | 8d7f53f84c6c6d31e51a48c8e327b628edda2adfc10afba70b148f674ae9c59d |
File details
Details for the file azapy-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: azapy-1.1.1-py3-none-any.whl
- Upload date:
- Size: 121.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbfbcaf0c1db78f6f3d66051cd925b5920b8d937386ae05475a0ebf571d2ce4d |
|
MD5 | aca53dc4834023ae0ececd9ff00261ff |
|
BLAKE2b-256 | 43f7da652ae10c23827044b3385c91153b9d3c12ecd5cd4af7f5115e40f03c77 |