Pakistan Stock Market Prediction Using LSTM
Keywords:
Stock Prediction, Long-ShortTerm Memory, Deep Learning, Stock Portfolio, Classification, Deep Neural NetworkAbstract
Accurate prediction of stock market movements is critical for investors and financial institutions. This paper presents a predictive model for the Pakistan Stock Exchange (KSE-100 Index) using a Bidirectional Long Short-Term Memory (BiLSTM) neural network augmented with multiple technical indicators, including Simple Moving Average (SMA), Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD), and Bollinger Bands. The proposed model predicts both closing prices and trend directions (up/down) of the index. Experimental results demonstrate that the model achieves a Mean Absolute Error (MAE) of 155.52, Root Mean Squared Error (RMSE) of 195.46, and a trend prediction accuracy of 74.03%, significantly outperforming the baseline models. These results demonstrate the effectiveness of combining deep learning with technical indicators for financial time series forecasting. The approach provides valuable insights for algorithmic trading and decision-making in the Pakistani stock market.
References
A. A. Adebiyi, A. O. Adewumi, and C. K. Ayo, “Stock price prediction using the ARIMA model,” Proc. - UKSim-AMSS 16th Int. Conf. Comput. Model. Simulation, UKSim 2014, pp. 106–112, 2014, doi: 10.1109/UKSIM.2014.67.
A. A. Adebiyi, A. O. Adewumi, and C. K. Ayo, “Comparison of ARIMA and Artificial Neural Networks Models for Stock Price Prediction,” J. Appl. Math., vol. 2014, no. 1, p. 614342, Jan. 2014, doi: 10.1155/2014/614342.
S. Hochreiter and J. Schmidhuber, “Long Short-Term Memory,” Neural Comput., vol. 9, no. 8, pp. 1735–1780, 1997, doi: 10.1162/neco.1997.9.8.1735.
W. Bao, J. Yue, and Y. Rao, “A deep learning framework for financial time series using stacked autoencoders and long-short term memory,” PLoS One, vol. 12, no. 7, Jul. 2017, doi: 10.1371/JOURNAL.PONE.0180944.
K. Chen, Y. Zhou, and F. Dai, “A LSTM-based method for stock returns prediction: A case study of China stock market,” Proc. - 2015 IEEE Int. Conf. Big Data, IEEE Big Data 2015, pp. 2823–2824, Dec. 2015, doi: 10.1109/BIGDATA.2015.7364089.
S. Borovkova and I. Tsiamas, “An ensemble of LSTM neural networks for high-frequency stock market classification,” J. Forecast., vol. 38, no. 6, pp. 600–619, Sep. 2019, doi: 10.1002/FOR.2585;PAGE:STRING:ARTICLE/CHAPTER.
J. G. Brida and W. A. Risso, “Hierarchical structure of the German stock market,” Expert Syst. Appl., vol. 37, no. 5, pp. 3846–3852, May 2010, doi: 10.1016/J.ESWA.2009.11.034.
T. Fischer and C. Krauss, “Deep learning with long short-term memory networks for financial market predictions,” Eur. J. Oper. Res., vol. 270, no. 2, pp. 654–669, Oct. 2018, doi: 10.1016/J.EJOR.2017.11.054.
S. Chen and L. Ge, “Exploring the attention mechanism in LSTM-based Hong Kong stock price movement prediction,” Quant. Financ., vol. 19, no. 9, pp. 1507–1515, 2019, doi: 10.1080/14697688.2019.1622287.
P. F. Pai and C. S. Lin, “A hybrid ARIMA and support vector machines model in stock price forecasting,” Omega, vol. 33, no. 6, pp. 497–505, Dec. 2005, doi: 10.1016/J.OMEGA.2004.07.024.
K. J. Kim and I. Han, “Genetic algorithms approach to feature discretization in artificial neural networks for the prediction of stock price index,” Expert Syst. Appl., vol. 19, no. 2, pp. 125–132, Aug. 2000, doi: 10.1016/S0957-4174(00)00027-0.
W. Huang, Y. Nakamori, and S. Y. Wang, “Forecasting stock market movement direction with support vector machine,” Comput. Oper. Res., vol. 32, no. 10, pp. 2513–2522, Oct. 2005, doi: 10.1016/J.COR.2004.03.016.
M. Gashler, C. Giraud-Carrier, and T. Martinez, “Decision Tree Ensemble: Small Heterogeneous Is Better Than Large Homogeneous,” pp. 900–905, Mar. 2009, doi: 10.1109/ICMLA.2008.154.
T. S. Chang, “A comparative study of artificial neural networks, and decision trees for digital game content stocks price prediction,” Expert Syst. Appl., vol. 38, no. 12, pp. 14846–14851, Nov. 2011, doi: 10.1016/J.ESWA.2011.05.063.
M. Ballings, D. Van Den Poel, N. Hespeels, and R. Gryp, “Evaluating multiple classifiers for stock price direction prediction,” Expert Syst. Appl., vol. 42, no. 20, pp. 7046–7056, Nov. 2015, doi: 10.1016/J.ESWA.2015.05.013.
C. J. Lu, T. S. Lee, and C. C. Chiu, “Financial time series forecasting using independent component analysis and support vector regression,” Decis. Support Syst., vol. 47, no. 2, pp. 115–125, May 2009, doi: 10.1016/J.DSS.2009.02.001.
P. Ou and H. Wang, “Prediction of Stock Market Index Movement by Ten Data Mining Techniques,” Mod. Appl. Sci., vol. 3, no. 12, p. p28, Nov. 2009, doi: 10.5539/MAS.V3N12P28.
S. PrasadDas and S. Padhy, “Support Vector Machines for Prediction of Futures Prices in Indian Stock Market,” Int. J. Comput. Appl., vol. 41, no. 3, pp. 22–26, Mar. 2012, doi: 10.5120/5522-7555.
C. Hargreaves and Y. Hao, “Does the use of technical & fundamental analysis improve stock choice?: A data mining approach applied to the Australian stock market,” ICSSBE 2012 - Proceedings, 2012 Int. Conf. Stat. Sci. Bus. Eng. "Empowering Decis. Mak. with Stat. Sci., pp. 109–114, 2012, doi: 10.1109/ICSSBE.2012.6396537.
W. Y. Loh, “Fifty years of classification and regression trees,” Int. Stat. Rev., vol. 82, no. 3, pp. 329–348, Dec. 2014, doi: 10.1111/INSR.12016;ISSUE:ISSUE:DOI.
A. Graves, M. Liwicki, S. Fernández, R. Bertolami, H. Bunke, and J. Schmidhuber, “A novel connectionist system for unconstrained handwriting recognition,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 31, no. 5, pp. 855–868, 2009, doi: 10.1109/TPAMI.2008.137.
Z. Guo, H. Wang, Q. Liu, and J. Yang, “A Feature Fusion Based Forecasting Model for Financial Time Series,” PLoS One, vol. 9, no. 6, p. e101113, Jun. 2014, doi: 10.1371/JOURNAL.PONE.0101113.
Y. Liu, “Novel volatility forecasting using deep learning–Long Short Term Memory Recurrent Neural Networks,” Expert Syst. Appl., vol. 132, pp. 99–109, Oct. 2019, doi: 10.1016/J.ESWA.2019.04.038.
P. Gao, R. Zhang, and X. Yang, “The Application of Stock Index Price Prediction with Neural Network,” Math. Comput. Appl. 2020, Vol. 25, Page 53, vol. 25, no. 3, p. 53, Aug. 2020, doi: 10.3390/MCA25030053.
S. Barak and M. Modarres, “Developing an approach to evaluate stocks by forecasting effective features with data mining methods,” Expert Syst. Appl., vol. 42, no. 3, pp. 1325–1339, Feb. 2015, doi: 10.1016/J.ESWA.2014.09.026.
H. K. Alazmi, A. Z. Metwaly, and M. M. Albaz, “The Effect of Corporate Governance on Firm Performance:A Field Study on Electronic Sector in Egypt,” Int. J. Account. Manag. Sci., vol. 2, no. 4, Apr. 2023, doi: 10.56830/IJAMS10202302.
S. Lahmiri, “Linear and nonlinear dynamic systems in financial time series prediction,” Manag. Sci. Lett., vol. 2, no. 7, pp. 2551–2556, Oct. 2012, doi: 10.5267/J.MSL.2012.07.009.
N. Levin and J. Zahavi, “Predictive modeling using segmentation,” J. Interact. Mark., vol. 15, no. 2, pp. 2–22, Jan. 2001, doi: 10.1002/DIR.1007.
S. Pyo, J. Lee, M. Cha, and H. Jang, “Predictability of machine learning techniques to forecast the trends of market index prices: Hypothesis testing for the Korean stock markets,” PLoS One, vol. 12, no. 11, Nov. 2017, doi: 10.1371/JOURNAL.PONE.0188107.
Carol Hargreaves, “(PDF) Machine Learning Application In The Financial Markets Industry,” Indian Journal of Scientific Research. Accessed: Jan. 30, 2026. [Online]. Available:https://www.researchgate.net/publication/327306054_Machine_Learning_Application_In_The_Financial_Markets_Industry
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 50sea

This work is licensed under a Creative Commons Attribution 4.0 International License.


















