Skip to main content

Optimize you portfolio!

Project description

Portfolio Optimizer

This project implements the simple Markowitz portfolio optimization model. It is the foundation of modern portfolio theory.

The assumptions of the model are:

  1. Risk of a portfolio is based on the variability of returns from said portfolio.
  2. An investor is risk averse.
  3. An investor prefers to increase consumption.
  4. The investor's utility function is concave and increasing, due to their risk aversion and consumption preference.
  5. Analysis is based on single period model of investment.
  6. An investor either maximizes their portfolio return for a given level of risk or minimizes their risk for a given return.
  7. An investor is rational in nature.

More information on theory and calculations can be found on: https://en.wikipedia.org/wiki/Modern_portfolio_theory

The algorithm needs a timestamped dataset of stock prices, which can be obtained from Yahoo Finance, Google Finance or other sources. A sample table structure is as follows:

The algorithm will provide the efficient frontier visually:

and the optimal portfolio weights numerically:

Requirements

  • numpy==1.26.3
  • pandas==2.1.4
  • matplotlib==3.8.1
  • scipy==1.11.4

Documentation

https://portfolio-optimizer.readthedocs.io/en/latest/

Source

https://github.com/SirArthur100/scientific_python

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

markowitz_portfolio_optimizer-1.26.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

markowitz_portfolio_optimizer-1.26-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file markowitz_portfolio_optimizer-1.26.tar.gz.

File metadata

File hashes

Hashes for markowitz_portfolio_optimizer-1.26.tar.gz
Algorithm Hash digest
SHA256 0839b7c7839bbdad841598a18b1a9b7617fd2e13187d0e315153cda6e2d306ec
MD5 67d768cae4fc564d690562b4d0424544
BLAKE2b-256 1d3454b5f5c33a2431a6c767b52976159f659ba98c899caf622155de5502f5ce

See more details on using hashes here.

File details

Details for the file markowitz_portfolio_optimizer-1.26-py3-none-any.whl.

File metadata

File hashes

Hashes for markowitz_portfolio_optimizer-1.26-py3-none-any.whl
Algorithm Hash digest
SHA256 a62794d125e6b59d3f5eb7666d1bab5acd2f7f5d521135a22a20f8792087fb22
MD5 0ec8c72359853c0c3d8511261199c01c
BLAKE2b-256 802829b537df2876ac73a75faa4e85b91a29872dc36661f9d6fc56c51e677ca3

See more details on using hashes here.

Supported by

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