Skip to main content

Financial Portfolio Optimization Algorithms

Project description

azapy project

Financial Portfolio Optimization Algorithms

An open-source python library for everybody

TimeSeries

Author: Mircea Marinescu

email: Mircea.Marinescu@outlook.com

Package documentation

Package installation: pip install azapy

ko-fi

A graphical user interface is provided by azapyGUI package.

Contents

A. Risk-based portfolio optimization algorithms

  1. mCVaR - mixture CVaR (Conditional Value at Risk)
  2. mSMCR - mixture SMCR (Second Moment Coherent Risk)
  3. mMAD - m-level MAD (Mean Absolute Deviation)
  4. mLSD - m-level LSD (Lower Semi-Deviation)
  5. mBTAD - mixture BTAD (Below Threshold Absolute Deviation)
  6. mBTSD - mixture BTSD (Below Threshold Semi-Deviation)
  7. GINI - Gini index (as in Corrado Gini statistician 1884-1965)
  8. SD - standard deviation
  9. MV - variance (as in mean-variance model)
  10. mEVaR - mixture EVaR (Entropic Value at Risk) (beta version)

For each class of portfolio the following optimization strategies are available

  1. Optimal-risk portfolio for targeted expected rate of return value
  2. Sharpe-optimal portfolio - maximization of generalized Sharpe ratio
  3. Sharpe-optimal portfolio - minimization of inverse generalized Sharpe ratio
  4. Minimum risk portfolio
  5. Optimal-risk portfolio for a fixed risk-aversion factor
  6. Optimal-risk portfolio with the same risk value as a benchmark portfolio (e.g., same as equal weighted portfolio)
  7. Optimal-diversified portfolio for targeted expected rate of return (minimization of inverse 1-D ratio) (beta version)
  8. Optimal-diversified portfolio for targeted expected rate of return (maximization of 1-D ratio) (beta version)
  9. Maximum diversified portfolio (beta version)
  10. Optimal-diversified portfolio with the same diversification factor as a benchmark portfolio (e.g., same as equal weighted portfolio) (beta version)
  11. 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

  1. Constant weighted portfolio. A particular case is equal weighted portfolio.
  2. Inverse volatility portfolio (i.e., portfolio weights are proportional to the inverse of asset volatilities)
  3. Inverse variance portfolio (i.e., portfolio weights are proportional to the inverse of asset variances)
  4. 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

  1. Kelly's portfolio (as in John Larry Kelly Jr. scientist 1923-1965) - maximization of portfolio log returns
  2. Universal portfolio (Thomas M. Cover 1996) (beta version)

D. Market Selectors

  1. Dual Momentum Selector (beta version)
  2. 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. 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.4

  • python 3.11.8
  • 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


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.4.tar.gz (113.0 kB view details)

Uploaded Source

Built Distribution

azapy-1.2.4-py3-none-any.whl (161.4 kB view details)

Uploaded Python 3

File details

Details for the file azapy-1.2.4.tar.gz.

File metadata

  • Download URL: azapy-1.2.4.tar.gz
  • Upload date:
  • Size: 113.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for azapy-1.2.4.tar.gz
Algorithm Hash digest
SHA256 4b9283a5a5cd532bcf2df19ad9c5c33f429a2b536eab5731ad13982d6a1dd874
MD5 7753b48e0f889502fcea784e9ed74393
BLAKE2b-256 1345ebb8b93ea5b4a0c1ed360a3e09c6b92061e776b5af04c38c1c2f02142eaa

See more details on using hashes here.

File details

Details for the file azapy-1.2.4-py3-none-any.whl.

File metadata

  • Download URL: azapy-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 161.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for azapy-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 62a47c88827390d4294ac458f64c3f67a5f2280ac1e6c7d8e72407a742950d6a
MD5 21dce6f462c8f491c62c527f6f1b378c
BLAKE2b-256 e07c5214b0ab501843ec89676c51afc97a4f014c0b2cf2ad290d15ff798a508d

See more details on using hashes here.

Supported by

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