Here, I used Stacked LSTM (Long Short-Term Memory) algorithm to predict stock prices. LTSM is one type of recurrent neural network which is used to learn order dependence in sequence prediction problems. Due to its capability of storing past information, LSTM is very useful in predicting stock prices. This is because the prediction of a future stock price is dependent on the previous prices.
- Acquisition of Stock Data.
- Visualizing Stock Prices History.
- Data Preprocessing.
- Preparation of Training and Testing Dataset.
- Setting Up LSTM Network Architecture.
- Training LSTM Model.
- Model Evaluation.
- Visualizing the Predicted Prices.
LSTM can be another great tool for stock price prediction. However, this is important to note that the predicted stock prices shall not be used as a solely definitive guide to make an investment decision without further analysis. This is because the prediction is only based on the historical prices movement that usually won’t be the only factor that affects the future price movement.
The main limitation of using any machine learning algorithm in predicting stock prices is that we can only backtest the historical data but the price movement does not necessarily follow the historical trend in various unforeseen circumstances. That’s the reason a further fundamental/market analysis is required here to support our investment decision making.