LSTM Deep Learning Based Stock Price Prediction with Bollinger Band, RSI, MACD, and OHLC Features.

Authors

  • Rahul Maruti Dhokane, Sohit Agarwal

Keywords:

Deep Learning, Machine Learning, LSTM, Stock Price Prediction

Abstract

The prediction of stock prices is a challenging task due to the volatility of stock prices. This research article aims to identify the effectiveness of using different technical indicators and the LSTM neural network machine learning algorithm for predicting trends and stock prices. This study used historical stock price data from the National Stock Exchange of India (NSE) for the period from January 1, 2020, to July 10, 2023, and used the Yahoo Finance API, which provides Open, High, Low, and Close (OHLC) values. By using these values, we calculated different technical indicators such as the Relative Strength Index (RSI), Bollinger Bands, and Moving Average Convergence Divergence (MACD) and used these indicators as features. In this study, the next day's closing price of stocks and trend are predicted using the Long Short-Term Memory (LSTM) algorithm. The performance of this model is evaluated using different metrics such as R-squared (R2 score), mean absolute percentage error (MAPE), and root mean squared error (RMSE). The trend identified is measured with the help of the confusion matrix. Sample stocks such as RELIANCE, ASIAN PAINTS, HINDUSTAN UNILEVER, KOTAK BANK, and INFOSYS were selected for study purposes. The results of this study demonstrate the ability of combining technical indicators and LSTM neural networks for stock price prediction and trend prediction.

Downloads

Download data is not yet available.

References

S. S. Roy, D. Mittal, A. Basu, and A. Abraham, “Stock Market Forecasting Using LASSO Linear Regression Model,” Advances in Intelligent Systems and Computing, pp. 371–381, 2015, doi: 10.1007/978-3-319-13572-4_31.

X. Zhong and D. Enke, “Predicting the daily return direction of the stock market using hybrid machine learning algorithms,” Financial Innovation, vol. 5, no. 1, Jun. 2019, doi: 10.1186/s40854-019-0138-0.

S. Selvin, R. Vinayakumar, E. A. Gopalakrishnan, V. K. Menon, and K. P. Soman, “Stock price prediction using LSTM, RNN and CNN-sliding window model,” 2017 International Conference on Advances in Computing, Communications and Informatics (ICACCI), Sep. 2017, Published, doi: 10.1109/icacci.2017.8126078.

M. Li, Y. Zhu, Y. Shen, and M. Angelova, “Clustering-enhanced stock price prediction using deep learning,” World Wide Web, vol. 26, no. 1, pp. 207–232, Apr. 2022, doi: 10.1007/s11280-021-01003-0.

Y. Wu, Z. Fu, ·Xiaoxuan Liu, and ·Yuan Bing, “A hybrid stock market prediction model based on GNG and reinforcement learning,” Expert Systems with Applications, vol. 228, p. 120474, Oct. 2023, doi: 10.1016/j.eswa.2023.120474.

X. Zhong and D. Enke, “A comprehensive cluster and classification mining procedure for daily stock market return forecasting,” Neurocomputing, vol. 267, pp. 152–168, Dec. 2017, doi: 10.1016/j.neucom.2017.06.010.

K. Liagkouras and K. Metaxiotis, “Stock Market Forecasting by Using Support Vector Machines,” Learning and Analytics in Intelligent Systems, pp. 259–271, 2020, doi: 10.1007/978-3-030-49724-8_11.

R. K. Dash, T. N. Nguyen, K. Cengiz, and A. Sharma, “Fine-tuned support vector regression model for stock predictions,” Neural Computing and Applications, vol. 35, no. 32, pp. 23295–23309, Mar. 2021, doi: 10.1007/s00521-021-05842-w.

R. M. Dhokane and O. P. Sharma, “A Comprehensive Review of Machine Learning for Financial Market Prediction Methods,” 2023 International Conference on Emerging Smart Computing and Informatics (ESCI), Mar. 2023, Published, doi: 10.1109/esci56872.2023.10099791.

L. N. Mintarya, J. N. M. Halim, C. Angie, S. Achmad, and A. Kurniawan, “Machine learning approaches in stock market prediction: A systematic literature review,” Procedia Computer Science, vol. 216, pp. 96–102, 2023, doi: 10.1016/j.procs.2022.12.115.

D. Bhuriya, G. Kaushal, A. Sharma, and U. Singh, “Stock market predication using a linear regression,” 2017 International conference of Electronics, Communication and Aerospace Technology (ICECA), Apr. 2017, Published, doi: 10.1109/iceca.2017.8212716.

J. M. Sangeetha and K. J. Alfia, “Financial stock market forecast using evaluated linear regression based machine learning technique,” Measurement: Sensors, vol. 31, p. 100950, Feb. 2024, doi: 10.1016/j.measen.2023.100950.

H. He, J. Chen, H. Jin, and S.-H. Chen, “Trading Strategies Based on K-means Clustering and Regression Models,” Computational Intelligence in Economics and Finance, pp. 123–134, doi: 10.1007/978-3-540-72821-4_7.

Y. Chen, J. Wu, and Z. Wu, “China’s commercial bank stock price prediction using a novel K-means-LSTM hybrid approach,” Expert Systems with Applications, vol. 202, p. 117370, Sep. 2022, doi: 10.1016/j.eswa.2022.117370.

R. Corizzo and J. Rosen, “Stock market prediction with time series data and news headlines: a stacking ensemble approach,” Journal of Intelligent Information Systems, vol. 62, no. 1, pp. 27–56, Jul. 2023, doi: 10.1007/s10844-023-00804-1.

J. Shen and M. O. Shafiq, “Short-term stock market price trend prediction using a comprehensive deep learning system,” Journal of Big Data, vol. 7, no. 1, Aug. 2020, doi: 10.1186/s40537-020-00333-6.

S. Mehtab, J. Sen, and A. Dutta, “Stock Price Prediction Using Machine Learning and LSTM-Based Deep Learning Models,” Communications in Computer and Information Science, pp. 88–106, 2021, doi: 10.1007/978-981-16-0419-5_8.

Z. Jin, Y. Yang, and Y. Liu, “Stock closing price prediction based on sentiment analysis and LSTM,” Neural Computing and Applications, vol. 32, no. 13, pp. 9713–9729, Sep. 2019, doi: 10.1007/s00521-019-04504-2.

S. Usmani and J. A. Shamsi, “LSTM based stock prediction using weighted and categorized financial news,” PLOS ONE, vol. 18, no. 3, p. e0282234, Mar. 2023, doi: 10.1371/journal.pone.0282234.

S. Mehtab and J. Sen, “Stock Price Prediction Using Convolutional Neural Networks on a Multivariate Time Series,” Aug. 2021, Published, doi: 10.36227/techrxiv.15088734.v1.

R. Qiao, W. Chen, and Y. Qiao, “Prediction of stock return by LSTM neural network,” Applied Artificial Intelligence, vol. 36, no. 1, Dec. 2022, doi: 10.1080/08839514.2022.2151159.

N. Sreenu, “Effect of Exchange Rate volatility and inflation on stock market returns Dynamics - evidence from India,” International Journal of System Assurance Engineering and Management, vol. 14, no. 3, pp. 836–843, May 2023, doi: 10.1007/s13198-023-01914-3.

A. Moghar and M. Hamiche, “Stock Market Prediction Using LSTM Recurrent Neural Network,” Procedia Computer Science, vol. 170, pp. 1168–1173, 2020, doi: 10.1016/j.procs.2020.03.049.

W. M. Shaban, E. Ashraf, and A. E. Slama, “SMP-DL: a novel stock market prediction approach based on deep learning for effective trend forecasting,” Neural Computing and Applications, vol. 36, no. 4, pp. 1849–1873, Nov. 2023, doi: 10.1007/s00521-023-09179-4.

S. Srivastava, M. Pant, and V. Gupta, “Analysis and prediction of Indian stock market: a machine-learning approach,” International Journal of System Assurance Engineering and Management, vol. 14, no. 4, pp. 1567–1585, Jul. 2023, doi: 10.1007/s13198-023-01934-z.

“Understanding LSTM Networks -- colah’s blog,” Understanding LSTM Networks -- colah’s blog. https://colah.github.io/posts/2015-08-Understanding-LSTMs/ (accessed Feb. 15, 2024).

“Yahoo Finance - Stock Market Live, Quotes, Business & Finance News,” Yahoo Finance - Stock Market Live, Quotes, Business & Finance News. https://finance.yahoo.com/ (accessed Feb. 15, 2024).

Downloads

Published

16.03.2024

How to Cite

Sohit Agarwal, R. M. D. . (2024). LSTM Deep Learning Based Stock Price Prediction with Bollinger Band, RSI, MACD, and OHLC Features. International Journal of Intelligent Systems and Applications in Engineering, 12(3), 1169–1176. Retrieved from https://ijisae.org/index.php/IJISAE/article/view/5396

Issue

Section

Research Article