Inspiration

Our main inspiration was the Goldman Sachs challenge that asked of us to make a predictor based on how risky a portfolio was. We also enjoy investing ourselves.

What it does

It uses the Kelly criterion and a number of environmental risk factors to calculate the risk to reward ratio of every asset held and the theoretical optimal portfolio allocation for those assets. The project then calculates the ratio of actual portfolio allocation to theoretical allocation to display the risk of the portfolio and show which assets you have accepted too much risk with. It also displays a final %Optimal number which communicates the ratio of your expected earning to the theoretical maximum at the level of risk you have currently assumed.

How we built it

We used Python and a web scraper to pull data from yahoo finance when given different ETF tickers. We also included a GUI using Tkinter to take in the value. The rest of the calculations were performed using Numpy.

Challenges we ran into

A huge challenge we faced was trying to use an API that pulls stock market data through the sources that were given to us. Most of the APIs required us to pay for access to the data, so we decided to scrap that idea. This led to use creating a web scraper that essentially pulled the market data ourselves.

Accomplishments that we're proud of

Implementing the Kelly's criterion into our program and pulling data through the web scraper. We had a lot of issues in scraping data from Yahoo finance because of unknown class names and div elements. This led to us using xpath to get the exact value that Yahoo finance provides. We also had to mimic a user-agent to pull the data.

What we learned

We learned how to create a basic GUI in Python and using requests to make a basic web scraper. We also learned how to link all of our different files together to create a cohesive program.

What's next for Portfolio Risk Predictor

The goal is to implement other factors through the web scraper and to start pulling more market data. This also includes bond data to see how those impact your portfolio. We also plan on making the GUI easier to use.

Built With

Share this project:

Updates