Inspiration

I have started to get into stocks as I want to make sure that I have a good source of money before I retire. I am sure that it is not only me there are millions of other people who want to be secure as well. But the thing is I am not great with stocks and I simply don't have the time to constantly research stocks to make the right choices. But I can code, so I decided to create an app that would help other people like me make better financial decisions by using ML to predict stock prices for me.

What it does

This app gets data from yahoo finance through an API for more than 100 different stocks and then performs different data analyses. First, the data is used for long-term predictions with the help of Facebook Prophet, a model created by Facebook for this specific reason. Then moving 100 and 200 averages are created. These are two easy ways to help people learn about the trends of a stock. Whenever the 100 moving average goes above the 200 moving average that means it is the start of the up trend. Whenever the 100 moving average goes below the 200 moving average that is the start of the down trend. Lastly, the data is used for the LSTM model which is a variant of the RNN model that replicates the way our human brains work with long-term and short-term memory. The model takes the most recent 50 days of data tries to find a trend looks back to see if there has been a similar trend before and predicts the stock price for the next day. The model then adds this new number to the short-term memory and moves the very last day to long-term memory. This process is constantly being repeated. At the bottom of the page, there is a price for the next day.

How we built it

First I used a framework called streamlit that creates web apps for python. Then I used an API to connect to yahoo finance so that I could get the stock data. Then I used facebook prophet to predict long term. Then I provided stock analysis with moving averages. Then lastly I created an LSTM model with the help of tensorflow-keras to help predict short term.

Challenges we ran into

I was having a hard time training the LSTM model and it took way to long for the training to be completed. After resolving that issue the web page was taking way to long to load, so we had to pre train the model and then use it. This was also a huge problem as I had a hard time figuring out how to use the pre-trained model.

Accomplishments that we're proud of

I am happy that I was able to use a new ML model that I have never used in the past. I am glad that everything worked out well.

What we learned

I learned how to host a python web app with streamlit and how to create an LSTM model which was really difficult. I also learned a lot about stocks and how with just previous stock prices it is not to difficult to predict short-term.

What's next for FinForecast

I hope to maybe add some sort of authentication so that different users can have access to specific stock information that they are interested in. I would also like to see if I can come up with my own model for long term predictions.

Built With

  • facebook-prophet
  • gcp
  • lstm
  • python
  • streamlit
  • tensorflow
  • yahoo-finance
Share this project:

Updates