performance of the model in such situations. Table 5
shows the mean square error (MSE) of the S&P 500
index on the test set. The smaller MSE value indicates
that the prediction error of the model is low,
indicating that the model has strong prediction ability.
Table 5: The value of MSE.
evaluation index value
MSE 0.0048
4.5 NSEBANK vs. S&P 500 Index
While the MSE curves for both have similar swings,
the S&P 500 appears to have been more volatile. This
likely reflects an essential difference between the two
indices: the NSEBANK is more regional and
influenced by specific industries, while the S&P 500
is more global and diversified and influenced by more
macroeconomic factors.
5 CONCLUSIONS
This study investigates the use of Long Short-Term
Memory (LSTM) networks for predicting the closing
prices of the NSE Bank Index and the S&P 500 Index.
The research involved preprocessing historical price
data through normalization and sequence creation to
prepare it for model training. An LSTM model was
developed and optimized using Keras Tuner to
identify the most effective hyperparameters. The
findings reveal that the LSTM model significantly
outperforms traditional forecasting methods in
accuracy. By evaluating the model through mean
squared error and visual comparisons of predicted
versus actual prices, it was demonstrated that LSTM
effectively captures complex patterns in time series
data. This highlights the LSTM model's superior
forecasting ability, suggesting that it is a valuable tool
for financial predictions. The results indicate that
LSTM networks hold great potential for enhancing
future market forecasting, providing valuable insights
for investors and market analysts.
While this study demonstrates the advantages of
LSTM models in stock price prediction, several areas
warrant further investigation. Future research could
explore combining LSTM with other advanced
algorithms, such as GRU or Transformer models, to
assess their performance under varying market
conditions. Expanding the scope to include
additional financial indicators or longer time periods
could help evaluate the model’s robustness and
generalizability. Incorporating additional features,
such as market sentiment or macroeconomic
variables, might further improve prediction accuracy.
Lastly, examining the application of LSTM models in
real-time trading strategies could offer insights into
their practical utility and effectiveness. These future
directions will contribute to a deeper understanding
of LSTM applications in financial forecasting and
advance the field of financial technology.
REFERENCES
Bhandari, H.N., Rimal, B., Pokhrel, N.R., Rimal, R., Dahal,
K.R. and Khatri, R.K., 2022. Predicting stock market
index using LSTM. Machine Learning with
Applications, 9, p.100320.
Chen, K., Zhou, Y. and Dai, F., 2015, October. A LSTM-
based method for stock returns prediction: A case study
of China stock market. In 2015 IEEE international
conference on big data (big data) (pp. 2823-2824). IEEE.
Ghosh, A., Bose, S., Maji, G., Debnath, N. and Sen, S., 2019,
September. Stock price prediction using LSTM on Indian
share market. In Proceedings of 32nd international
conference on (Vol. 63, pp. 101-110).
Liu, S., Liao, G. and Ding, Y., 2018, May. Stock transaction
prediction modeling and analysis based on LSTM. In
2018 13th IEEE Conference on Industrial Electronics
and Applications (ICIEA) (pp. 2787-2790). IEEE.
Moghar, A. and Hamiche, M., 2020. Stock market
prediction using LSTM recurrent neural network.
Procedia computer science, 170, pp.1168-1173.
Nelson, D.M., Pereira, A.C. and De Oliveira, R.A., 2017,
May. Stock market's price movement prediction with
LSTM neural networks. In 2017 International joint conf.
on neural networks (IJCNN) (pp. 1419-1426). IEEE.
Rahman, L., Mohammed, N., & Al Azad, A. K. (2016,
September). A new LSTM model by introducing
biological cell state. In 2016 3rd International Conf. on
Electrical Engineering and Information Communication
Technology (ICEEICT) (pp. 1-6). IEEE.
Staudemeyer, R. C., & Morris, E. R. (2019). Understanding
LSTM--a tutorial into long short-term memory recurrent
neural networks. arXiv preprint arXiv:1909.09586.
Sunny, M.A.I., Maswood, M.M.S. and Alharbi, A.G., 2020,
October. Deep learning-based stock price prediction
using LSTM and bi-directional LSTM model. In 2020
2nd novel intelligent and leading emerging sciences
conference (NILES) (pp. 87-92). IEEE.
Wei, D., 2019, October. Prediction of stock price based on
LSTM neural network. In 2019 International
Conference on Artificial Intelligence and Advanced
Manufacturing (AIAM) (pp. 544-547). IEEE.
Yadav, A., Jha, C.K. and Sharan, A., 2020. Optimizing
LSTM for time series prediction in Indian stock market.
Procedia Computer Science, 167, pp.2091-2100.