AI,  Cloud

AI in finance – How we predicted NASDAQ Stocks

AI in finance – How we predicted NASDAQ Stocks

Since the genesis of AI (Artificial Intelligence), we have come a long way by using it to affect a wide range of applications. We use AI in various sectors like Finance, Education, Healthcare etc.

One such sector where humans have always thought of using Machine Learning and AI is for stock prediction. Countless people trade stocks every day. Many experts analyze the stocks to forecast it by minimizing risk. Predicting the values of these stocks beforehand would obviously be a great advantage. Before discussing our approach of using Machine Learning for predicting stocks, let us try to understand the patterns of stock markets first.

What are the stock prices actually dependent on?

Stock Trading is a complex field and involves a lot of variables and parameters, ranging from the working of the company, its decisions, and other technical factors, also subtle changes like changes in weather, government decisions, economic factors, etc also tend to affect Stock prices. But the most important factor is the transactions of the stocks.
When more people buy a particular stock, the stock(also known as the ticker) is under demand. So any news that is spread about the company, whether true or not, affects the stock price. That is why, even predicting stocks and thus using it to acquire said profit can also affect stock prices, Thus we can be very sure that predicting stock prices is a complex job, to put it mildly. It is known as a level-2 chaotic system, as the prediction or forecasting itself affects the future values, unlike a level-1 chaotic system like weather prediction.

What did we want to build?

Well, now it is clear that stock market prediction is quite a complex job and even if we do build a model that can predict a market stock, it’s highly unlikely that it will be accurate enough to try your money on. So what can we do is rather than predicting one stock of the market, we can predict all stocks or at least multiple stocks (including most important ones, of course) of the market.

 Now what we have to do is not just rely on numbers but the comparison between them. Now if you are going to put money on some stock, why not put it on the stock the algorithm predicted to be “Most likely to go up”, and thus minimizing risk. Lastly, that is what we want, don’t we?

How would this be helpful?

As I said earlier, the important part is not how much a stock will go up, its how a stock will go up in comparison with other stocks, especially the one you are planning to put your money on. That is what we want to do. If you are planning to put money in say, either Google or Apple, the prediction will help you decide which stock to put your money in.

Our Approach –

 We need another article to explain the technical details of our approach. Here is a brief overview of the approach:

 1. Adding data and Updating data :

    As the new data gets added every day, we have to update the data in S3 buckets. 

2. Initial Training:

    Create a model for each ticker and store it in S3.

3. Incremental Training:

     If new data is added, fetch the model and update the weights by training on the newly added data.

4. Prediction:

     Predict the stock values for a stock for next 2 weeks by fetching the model.
     I will publish my approach in detail in part 2.
     Stay tuned!

Contributed by: Saurabh Lodha

Machine Learning consulting