Optimize stock portfolios using mean-variance optimization and other strategies.
Project description
Portfolio Optimize
A simple Python package for optimizing investment portfolios using historical return data from Yahoo Finance. Users can easily determine the optimal portfolio allocation among a given set of tickers based on the mean-variance optimization method or other algorithms.
Features
- Easy-to-use interface for defining a portfolio of tickers.
- Supports customization of the data window (in years) for historical data analysis.
- Allows choosing between mean-variance optimization and other optimization algorithms.
- Includes functionality to plot the efficient frontier for the selected portfolio.
Installation
pip install portfolio-optimize
Usage
Portfolio Optimization
from portfolio_optimize import portfolio_optimize
# Optimize portfolio
optimal_weights = portfolio_optimize(tickers=["MSFT", "AAPL", "GOOG"], window=5, optimization="MV")
print(optimal_weights)
Plotting the Efficient Frontier
from portfolio_optimize import portfolio_optimize
# Plot the efficient frontier for a set of tickers
portfolio_optimize.graph(tickers=["MSFT", "AAPL", "GOOG"], window=5)
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
File details
Details for the file portfolio-optimize-0.1.0.tar.gz
.
File metadata
- Download URL: portfolio-optimize-0.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a88ea23b706cc77bcaabc4000194fdd338ffca4e16003523349b3d32c7f8a2a |
|
MD5 | e3114426dc78ca2e9c56b6b2d662f6a2 |
|
BLAKE2b-256 | 0b94d944c3c7f6c9842d66abce680ea0176e0113c90b61e9fa02c8f049a74a38 |
File details
Details for the file portfolio_optimize-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: portfolio_optimize-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83a12301ee5773c1c4d2f4fc3ee92e3af93e2623462054872542e4e9ba21c0e4 |
|
MD5 | 0239a92be682448097f443dbe56c912d |
|
BLAKE2b-256 | dd7339784db10969cbf83a8209341584c01612c06458ef2558a696b167a97a66 |