Skip to content

vg15o2/investment-portfolio-optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💰 Investment Portfolio Optimizer

"Risk comes from not knowing what you're doing." – Warren Buffett

A Python-powered tool that helps you optimize investment portfolios using Modern Portfolio Theory (MPT) and Monte Carlo simulations. Analyze, simulate, and visualize risk-return trade-offs with confidence. 📊📈


Table of Contents

  • Features
  • Installation
  • Usage
  • Visuals
  • Concepts
  • Contributing
  • License

Features

  • Fetch historical stock data using yfinance.
  • Perform Monte Carlo simulations to explore portfolio risk/return combinations.
  • Optimize portfolios for:
  • Maximum Sharpe Ratio
  • Minimum Volatility
  • Plot the Efficient Frontier.
  • Export allocation data and visuals for reporting.

Installation

  1. Clone the repository

    git clone https://github.com/your-username/investment-portfolio-optimizer.git
    cd investment-portfolio-optimizer
  2. Install dependencies

    pip install -r requirements.txt

Usage

1. Fetch Historical Data

python fetch_data.py --ticker AAPL --start 2020-01-01 --end 2021-01-01

2. Run Monte Carlo Simulations

python monte_carlo.py --iterations 1000

3. Optimize Portfolio

python optimize.py --objective sharpe_ratio

4. Plot Efficient Frontier

python plot_efficient_frontier.py

Visuals

Figure_1

Simulated portfolios, color-coded by Sharpe ratio. Red Star = Max Sharpe 📍 | Green Star = Min Volatility ✅

Figure_2

Concepts

Modern Portfolio Theory (MPT)

  • A strategy to construct a portfolio that maximizes return for a given level of risk.
  • Introduced by Harry Markowitz, focuses on diversification and the Efficient Frontier.

Monte Carlo Simulation

  • Generates thousands of portfolio combinations with random weights.
  • Helps estimate distribution of returns and identify optimal portfolios.

Contributing

We welcome contributions! 🛠️

  1. Fork the repo
  2. Create a branch: git checkout -b feature-branch
  3. Commit your changes: git commit -am 'Add new feature'
  4. Push the branch: git push origin feature-branch
  5. Create a Pull Request!

📄 License

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


About

A Python tool to optimize investment portfolios using Modern Portfolio Theory (MPT).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages