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:
- Risk of a portfolio is based on the variability of returns from said portfolio.
- An investor is risk averse.
- An investor prefers to increase consumption.
- The investor's utility function is concave and increasing, due to their risk aversion and consumption preference.
- Analysis is based on single period model of investment.
- An investor either maximizes their portfolio return for a given level of risk or minimizes their risk for a given return.
- 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file markowitz_portfolio_optimizer-1.27.tar.gz.
File metadata
- Download URL: markowitz_portfolio_optimizer-1.27.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e3135e4112461b53fed2d3589c0b46a7018afe6f765d98277ac88695e43c5e7
|
|
| MD5 |
16ca80d2f63b89616a1ac4f725871993
|
|
| BLAKE2b-256 |
ff0c2293cd7deafac61cb6af952b542768fd2f63a382507bc72d1343241ebacf
|
File details
Details for the file markowitz_portfolio_optimizer-1.27-py3-none-any.whl.
File metadata
- Download URL: markowitz_portfolio_optimizer-1.27-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1648054bdcdee8236c23959aacffe4bec140199d5909225ab443e479f378dceb
|
|
| MD5 |
c9a646a4e0991688033f148a15cf5cd9
|
|
| BLAKE2b-256 |
5e027e952338d8171e2f1daea106f5e4a1a74d533b76910cd903f9587f5b853c
|