Skip to content

malcolm-decuire/decuresolutions-streamlit-pyportfolio

Repository files navigation

What is this app

  • Python project dedicated toward quant & adtech folks
  • Fintech that leverages the PyPortfolioOpt to analyze REIT & Adtech securities -Tickers Analyzed: AMT,DLR, DV,EQIX,IPG,LAMR,OMC,PLD,PSA,SPG,WELL,ZD,ZETA

Updated Project Summary Due Q2-2027

  • Clean up uneccesary files
  • Expand on the examples and leverage more of the PyPortoflio libraries
  • Integrate LLM for backtesting

202412 HOTFIX

  • YFINANCE LIB WAS THROWING ERRORS THAT THERE WERE NO TICKER SYMBOLS AVAILABLE
  • ERROR IS POSSIBLY DUE TO HITTING API LIMIT WITHIN A 2 WEEK PERIOD
  • UPDATED ENTIRE PROJECT TO USE LOCAL EODHD PURCHASED 202406 AND THEN LEVERAGE THAT FOR PROJECT UNTIL UPDATED YFINANCE ISSUE

Predecessors & Influencers

  • In a prior year, a team named "Wall Street Bets" (Lana Butorovic, Austen Johnson, Joseph Min, and Ryan Schmid) wrote a web app hosted out of this repo. They used PyPortfolioOpt to plot the efficient frontier and tangency portfolio, and then developed a short quiz to assess the risk aversion parameter for a quadratic utility maximizing investor. With this parameter, they suggested a utlity maximizing portfolio.

  • Sadly, their site is no longer working because Heroku, where they hosted it, stopped free services.

  • Don Bowen their project here to demonstrate the use of Streamlit for dashboard development and deployment. I've refactored the code in places and added a small tweak to the code to allow for levered portfolios (by shorting the risk free asset).

You can see this dashboard in action here!

Quick Start

Requirements

  • Due to the changing nature of dependencies, user may experience errors like: library,, OS, and other issues around code not being able to perform calculations
  • Currently working on documenting these issues more, but see original project to learn more at [PyPi] (https://pyportfolioopt.readthedocs.io/en/latest/ index.html)

Data

  • App will throw an error if a ticker in the asset list or in the hardcoded array is missing or something is wrong w/ their data feed
  • Removed PEAK, ADTH for this reason

If you want to get this app working on your computer so you can use it, play around with it, or modify it, you need:

  1. A working python / Anaconda installation
  2. Git

Then, open a terminal and run these commands one at a time:

# download files (you can do this via github desktop too)
cd <path to your FIN377 folder> # make sure the cd isn't a repo or inside a repo!
git clone https://github.com/donbowen/portfolio-frontier-streamlit-dashboard.git

# move the terminal to the new folder (adjust next line if necessary)
cd portfolio-frontier-streamlit-dashboard  

# this deletes the .git subfolder, so you can make this your own repo
# MAKE SURE THE cd IS THE portfolio-frontier-streamlit-dashboard FOLDER FIRST!
rm -r -fo .git 

# set up the packages you need for this app to work 
# (YOU CAN SKIP THESE if you have already streamlit-env, or you can 
# give this one a slightly diff name by modifying the environment.yml file)
conda env create -f streamlit_env.yml
conda activate streamlit-env

# start the app in a browser window
streamlit run app.py

# open any IDE you want to modify app - spyder > jupyterlab for this
spyder  # and when you save the file, the app website will update

To deploy the site on the web,

  1. Use Github Desktop to make this a repo your own account.
  2. Go to streamlit's website, sign up, and deploy it by giving it the URL to your repo.
  3. Wait a short time... and voila!

Update requests

  1. Easy for me: Add Github action to run update_data_cache.py once a month.
  2. Easy for anyone: The requirements file has no version restrictions. We should set exact versions.

Notes

While it seems duplicative to have a requirements.txt and a streamlit_env.yml, the former is needed by Streamlit and the latter makes setting up a conda environment quickly easy. So keep both.

Releases

No releases published

Packages

No packages published

Languages