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.27.tar.gz (26.4 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.27-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for markowitz_portfolio_optimizer-1.27.tar.gz
Algorithm Hash digest
SHA256 1e3135e4112461b53fed2d3589c0b46a7018afe6f765d98277ac88695e43c5e7
MD5 16ca80d2f63b89616a1ac4f725871993
BLAKE2b-256 ff0c2293cd7deafac61cb6af952b542768fd2f63a382507bc72d1343241ebacf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for markowitz_portfolio_optimizer-1.27-py3-none-any.whl
Algorithm Hash digest
SHA256 1648054bdcdee8236c23959aacffe4bec140199d5909225ab443e479f378dceb
MD5 c9a646a4e0991688033f148a15cf5cd9
BLAKE2b-256 5e027e952338d8171e2f1daea106f5e4a1a74d533b76910cd903f9587f5b853c

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