Skip to content

Predicting Equity Prices for multiple asset classes. This type of model works for different types of Equities once data is fetched in the form required.

License

Notifications You must be signed in to change notification settings

ChintzRuparel/Stock-Market-Prediction-Using-LSTM

Repository files navigation

Stock-Market-Prediction-Using-LSTM 📈

Predicting Equity Prices for multiple asset classes. This type of model works for different types of Equities once data is fetched in the form required. Pricing equities has been a tough target for most people who try stock markets causing them enormous amount of pilling losses. Here we have used a complex Neural Network to predict equity prices based on previous historical data.

What is LSTM? 🤖

LSTM stands for Long Short Term Memory. Long Short-Term Memory (LSTM) is a type of Recurrent Neural Network (RNN) that is specifically designed to handle sequential data, such as time series, speech, and text. LSTM networks are capable of learning long-term dependencies in sequential data, which makes them well suited for tasks such as language translation, speech recognition, and time series forecasting.
A traditional RNN has a single hidden state that is passed through time, which can make it difficult for the network to learn long-term dependencies. LSTMs address this problem by introducing a memory cell, which is a container that can hold information for an extended period of time. The memory cell is controlled by three gates: the input gate, the forget gate, and the output gate. These gates decide what information to add to, remove from, and output from the memory cell.

How does the code Flow? ⏳

  • Step 1- Importing Python Libraries
  • Step 2 - Dataset Reading
  • Step 3 - Pre Processing the data and getting the Overall Structure of the data to start with data modelling
  • Step 4 - Plotting the chart against the historical prices.
  • Step 5 - Plot the Closing prices in different charts - Trend || Seasonal || Resid
  • Step 6 - Splitting the data into the ratio of 70% Training Dataset and 30%Test Dataset
  • Step 7 - Windowing Dataset
  • Step 8 - Implementing LSTM will start from here || The above steps can be considered as Pre-Processing and Splitting of the Dataset
  • Step 9 - Import Keras and Tensorflow libraries for LSTM Network
  • Step 10 - Fitting data to the model and Selecting the number of ePochs required
  • Step 11 - Get a set of values and then evaluate the model and calculate Root Mean Square Error and R-Squared Score
  • Step 12 - Plot the stock price and Predicted values || The difference between the predicted value and stock prices is called the Root Mean Square Error (RMSE)
  • Step 13 - Predicting Future Price Update - For making it as realtime as possible, We have predicted 30 day trend
  • Step 14 - Plotting Past Prices and Predicted Values for the next 30 days

Stocks and Equities test runs 🧪

  • Apple
  • HDFC Bank
  • India VIX
  • Nifty FMCG
  • Nifty IT
  • Nifty 100
  • Nifty 50
  • Nifty 500
  • Nifty Auto
  • Nifty Bank
  • Nifty Metal
  • Nifty Midcap
  • Nifty Pharma
  • Nifty Smallcap
  • Reliance Industries
  • Tata Global Products

How to use it? 💻

  • Download "Index" Jupyter Notebook file of main
  • Fetch equity Database from exchange
  • Assign the database in the file [A comment has been mentioned for the same]
  • Run the file
  • Results are then fetched

Development is still under Process

About

Predicting Equity Prices for multiple asset classes. This type of model works for different types of Equities once data is fetched in the form required.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published