Inspiration
We did a very similar project a few years ago that focused more on the structured long-term investment strategies that were utilized. This original project was inspired by our desire to not have a job. The project we’re submitting focuses on the other aspect of stock trading – day trading.
What it does
Instead of using articles and previous days’ data and inputting that directly into an AI, we only used the hourly data for the opened days, and then performed the Fast Fourier Transform on it to estimate the functions that make up the market. We then used this with an AI model to predict the value of the price as well as whether the value is going up or down. Although the value can help predict if the value is going up or down, we found that the error is within $6, so having both could help make a better informed decision.
How we built it
We took hourly data from the past two years with data intervals of 1 hour for major tech companies: NVIDIA, Intel, AMD, Microsoft, Apple, Google, and Meta. The stock market values are extremely noisy, so in order to reduce the noise, we utilized a Simple Moving Average that smooths out the signal. It averages a chosen number of days to smooth out the graph.
We then spliced the data to include a chosen value of 200 of the previous hours’ data per training point and got the next hour’s value as the label. We performed a Fast Fourier Transform (FFT) on which has a real and imaginary vector outputs. We then trained the AI model on these vectors as inputs.
Challenges we ran into
Since the stock market goes up and down constantly, Gohith thought an interesting idea was to help the model using either sinusoidal regression or a function that multiple two distinct sine waves together. He got the partial derivatives by hand and got a system of equations that we planned on solving numerically. Although we spent a long time figuring this out, this did not help the model as it is practically very similar to what a Fourier Transform outputs. This was a blow to our morale, but we still managed to pull through by still finding new ideas to implement, especially ones concerning overfitting.
Another challenge we dealt with was trying to use an LSTM to predict based on the sequence of stock prices. It is known that complicated models are more prone to overfitting, which happened especially in this case. It took multiple minutes per epoch to train, and the result being that it didn’t help was another dead end that we took.
The biggest challenge overall was dealing with overfitting. No matter what we did we weren’t able to get the testing accuracy to hit over 50%. This was until we used a couple dropout layers and more small dense layers to predict instead of a few large, bulky ones. Even though we thought this would work, it still took many attempts at trial and error to build a model that consistently broke the 54% barrier
Accomplishments that we're proud of
Overall the accuracy and the new approach we tried. Even though 54% doesn’t sound that high, the odds of winning at this game would be substantially higher than a professional card-counter in Vegas. We see this as a cause for celebration
What we learned
We learned not only about but also how to implement Fourier Transforms. We also learned a heavy amount of regression curves including how to estimate higher dimensional regressions. Even though it didn’t work, we’re still proud of the work we did.
Although we knew big networks would be more prone to overfitting, this was the first time we saw this idea in action.
What's next for RowdyStocks
One of the biggest ideas we have yet to implement is a voting system. There was a state of the art model for MNIST, a handwriting prediction dataset, that utilized 3 very basic neural networks to vote for a value. This resulted in an extremely high accuracy from not-so-great models. We wanted to implement this, but we unfortunately ran out of time.
Built With
- python
- tensorflow
- yfinance

Log in or sign up for Devpost to join the conversation.