Package: azapy
azapy projectFinancial Portfolio Optimization AlgorithmsAn open-source python library for everybodyAuthor: Mircea Marinescuemail:Mircea.Marinescu@outlook.comPackage documentationPackage installation:pip install azapyContentsA. Risk-based portfolio optimization algorithmsmCVaR - 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 deviationMV - 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 availableOptimal-risk portfolio for targeted expected rate of return valueSharpe-optimal portfolio - maximization of generalized Sharpe ratioSharpe-optimal portfolio - minimization of inverse generalized Sharpe
ratioMinimum risk portfolioOptimal-risk portfolio for a fixed risk-aversion factorOptimal-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 inverse1-Dratio)(beta version)Optimal-diversified portfolio for targeted expected rate of return
(maximization of1-Dratio)(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 strategiesConstant 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 strategiesKelly's portfolio (as in John Larry Kelly Jr. scientist 1923-1965) -
maximization of portfolio log returnsUniversal portfolio (Thomas M. Cover 1996)(alpha version)D. Market SelectorsDual Momentum Selector(alpha version)Correlation Clustering Selector(alpha version)Utility functions:Collect historical market data from various providers.Supported providers:yahoo.comeodhistoricaldata.comalphavantage.comarketstack.comGenerate 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 byazapy1.2.1python 3.11.2pandas 2.1.4numpy 1.26.2scipy 1.11.4statsmodels 0.14.0matplotlib 3.8.0plotly 5.9.0requests 2.31.0pandas_market_calendars 4.3.2ecos 2.0.12cvxopt 1.3.2ta 0.11.0yfinance 0.2.33