Skip to content

CS196Illinois/FA25-Group12

Repository files navigation

Group 12: Portfolio Optimizer

Group Name: TEAM_NAME

MVP Link

Team Members: Dligach2, Jingxil4, Ashwinp4, Zhuojun9, Davidk17, rongxiw2

Project Manager: pillai7


💸Suppose you have earned $1,000,000 cash from a job, you heard there is something called “money makes money”. You are interested because it makes you become rich.

📈Specifically, you want to invest your cash in multiple stocks, funds, or bonds to grow wealth, we call that Portfolio Investment. You noticed that different investments have different risks and returns, then how to distribute your money to make it earn the most while risking the least?

😎We have developed a portfolio optimizer. The program asks the user to input the intended stocks they want to invest in. We are calculating the expected return of each of their stocks, and giving the optimized suggestion on how to allocate their assets. We see a significant improvement in the annual return and Sharpe ratio with the optimized distribution of assets.

Features

  • Calculates the Annual Expected Return of stock i using CAPM
  • Calculates the actual Compound Annual Growth Rate of stock i with historical data
  • Visualizes the given stock's close price in 5 years with 20-day MA line
  • Optimizes portfolio allocation and outputs the percentage of asset's distribution under different strategies

Notes

  • Historical data means data from 5 years
  • You can input multiple stocks, one at a time, and it prints the return for each stock you input.
  • Rf: using the U.S. 10-year Treasury annual return
  • Rm: using S&P 500 index annual return

Dependencies

Get Started

You have to run BOTH Backend and Frontend commands to use our tool!

Windows 🪟

Open the first terminal to run Backend:

git clone "https://github.com/CS196Illinois/FA25-Group12.git"

cd FA25-Group12/Project/Backend
python -m pip install -r requirements.txt
python -m uvicorn version2:app --reload --port 8000

Open another terminal to run Frontend:

cd FA25-Group12/Project/Frontend/src/my-react-app
npm install
npm start

MacOS 🍎

  • On MacOS, Python is installed as python3, not python

Open the first terminal to run Backend:

git clone "https://github.com/CS196Illinois/FA25-Group12.git"
cd FA25-Group12/Project/Backend
python3 -m pip install -r requirements.txt
python3 -m uvicorn version2:app --reload --port 8000

Open another terminal to run Frontend:

cd FA25-Group12/Project/Frontend/src/my-react-app
npm install
npm start

Demo

image

Note for foreign stocks

When you enter a stock that’s outside the U.S. market, append the region/market to the end of its ticker. Example: Tencent(Tencent is listed in Hong Kong) → 0700.HK, Sony → 6758.T, whereas U.S. stocks like Apple stay AAPL.

Reference

Capital Asset Pricing Model (CAPM), calculating the expected return of an asset by assessing its risk compared to the overall market.

$$ {\Large E(R_i) = R_f + \beta (R_m - R_f)} $$

  • E(Ri): The Expected Return of Stock i

  • Rf: Risk-free Return

  • Rm: Expected Market Return

  • beta: Stock's Sensitivity to the market

Modern Portfolio Theory (MPT), balancing the expected return and risk in a portfolio of assets.

About

Project Repository for Group 12 (FA25)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8