Skip to main content

A Python package for portfolio optimization. (Note: This package is under ongoing development. Contributions and corrections are welcome!)

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.portfolio_optimize import PortfolioOptimize

# Initialize the optimizer
portfolio = PortfolioOptimize(tickers=["MSFT", "AAPL", "GOOG"], window=5, optimization="MV")

# Optimize the portfolio
optimal_weights = portfolio.optimize()

print(optimal_weights)

Plotting the Efficient Frontier

# Assuming you've already created and optimized the `portfolio` as shown above

# Plot the efficient frontier for the set of tickers
portfolio.graph()

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This software is provided for educational purposes only. It is not intended for financial, investment, trading, or any other type of professional advice. Use at your own risk. The author(s) and contributors do not accept any responsibility for any decisions or actions taken based on the use of this software. Always conduct your own research and consult with financial advisors before making any investment decisions.

Contributing

This project is under ongoing development, and contributions, corrections, and improvements are welcome. Please feel free to open issues or pull requests on GitHub GitHub if you have suggestions or code enhancements.

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

portfolio-optimize-0.3.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

portfolio_optimize-0.3.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file portfolio-optimize-0.3.0.tar.gz.

File metadata

  • Download URL: portfolio-optimize-0.3.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for portfolio-optimize-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c2cf70e0ae0dc8744026cce8aec5e5fa1d177c4b4e6cd99bf0748be7114035b7
MD5 b5e10958c5f633e8acfaa8ea03244203
BLAKE2b-256 d4fa445c6f8550a612fc75e0ebe3df93f668cc6a638a46c56e9ee2d38d7ea9f2

See more details on using hashes here.

File details

Details for the file portfolio_optimize-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for portfolio_optimize-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de1f2440beeb6798a45ad184dc2c9fe393348f6fd8165a2948c9bcc6472c2ee8
MD5 418881884f41ad6427266cd9e5b8d5c0
BLAKE2b-256 04d1274dc65d40c20b3450e5b839bb47971ac17e47b16627e8c8aa03d8d765a9

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