Inspiration
Wayne had previously done NLP research and got to work with several transformer models. After seeing the significant performance uplift transformers provided relative to existing RNN and LSTM models on a variety of NLP tasks, he wanted to see if transformers could be employed for other applications. Stock price prediction seemed to be such an application. Transformers can better model the complex relations in temporal financial data than RNNs and LSTMs, which are the predominant model architectures for this task.
What it does
Our model takes as input a series of financial statements and predicts the stock price movement direction immediately following the conclusion of the accounting period corresponding to the most recent financial statement inputted. The movement prediction is relative to the stock price at the start of the aforementioned accounting period.
How we built it
We used financial statement data from the SEC and stock prices from Yahoo Finance. The model was based off the code in a Tensorflow guide discussing a text generation model.
Challenges we ran into
It was difficult to reformat the financial statement data since the data from the SEC was inconsistently formatted. We had to use a lot of heuristics to make sure the data ultimately fed into the model was almost all correct. Training the model to increase its performance was also difficult, since there were so many modifications we could have tried.
Accomplishments that we're proud of
We were most excited when we got the model to start showing some signs of training (when predictions weren't completely random). We were a bit unsure about whether we could get to this point since models often need extensive tweaking before becoming performant.
What we learned
Based on the results, perhaps there isn't as much of a correlation between financials and stock prices as we had hoped to see. That said, there's still a lot of tweaks that can be explored to improve the model's performance.
What's next for Predicting Stock Price Movements from Financial Statements
Of course, we want to see what other tweaks we could apply to improve the model performance. After some time, we also want to investigate feeding the model sample financial statement data to see if we could spot relations that correspond to stock price movement. Such relations could be used to form metrics that help companies better understand their financial state.
Built With
- python
- tensorflow
- yahoo-finance
Log in or sign up for Devpost to join the conversation.