Inspiration
We were inspired by the notoriously volatile nature of the stock market where we thought it would be a fun challenge to try to come up with a model that could predict the risk and future growth of a user entered portfolio.
What it does
It allows the user to input their financial data including stock market assets, bonds, and savings and then uses several APIs to collect data on the historical prices of stocks, the interest rates of federal securities/bonds, the federal interest rate for borrowing between banks, as well as the unemployment rate. We then use this data along with several algorithms to estimate the annual growth of the user's portfolio, taking into account risk factors such as unemployment, volatility, and federal interest rates. Volatility is calculated as the denominator of the Sharpes Ratio. Also is able to generate a somewhat optimal portfolio for the user to compare with.
How we built it
We build the app in Python using Tkinter for the front end. We pulled data from several API's and used this data for calculations which we used to analyze the risk and performance of a portfolio.
Challenges we ran into
Some challenges that we ran into were that we were pulling data from several API's which all returned the data differently so we had to find an efficient way to aggregate the data and perform calculations on it. We also had the issue that the yfinance API was very slow so we had to reduce the amount of data that we pulled from their in our calculations in order for our app to run faster.
Accomplishments that we're proud of
We are proud that we were able to create a functioning app in less that 24 hours as that is better than we did last year. We are also proud that we were able to develop a pretty reasonable model for predicting risk and future growth while pulling data from several different sources and running calculations on that data.
What we learned
We learned how to use HTTPS requests to get data from API's and then use that data to perform calculations. We also learned how to develop a model based on past data and use that model to predict future growth and risk in the stock market.
What's next for Joe's Portfolio Risk Analysis
In the future we would like to find a way to be able to pull data from yfinance more efficiently as currently we are not able to use very much data in our calculations because it would be too slow if we pulled all the data we would like. We would also like to look into taking more factors in to account in order to get a more accurate model for predicting risk and future growth of a users portfolio.
Built With
- api-ninja
- python
- tkinter
- treasury-fianance-api
- yfinance
Log in or sign up for Devpost to join the conversation.