Predicting Stock Price Movements with Technical, Fundamental, and Sentiment Analysis Using the LSTM Model

Muhammad Ighfar Saputra, Erna Nurmawati, Rayhan Abyasa

Abstract


The challenge of minimizing risk and maximizing profit is what traders in the stock market have been endeavoring to solve for years. Stock prices typically exhibit the characteristic of volatility, influenced by various factors and necessitate a substantial amount of data to identify patterns in price movements. Considering the significant data requirements and the rapid advancement of big data and artificial intelligence, the LSTM (Long-Short Term Memory) model stands as a suitable approach for utilization in Deep Learning. The independent variables employed encompass technical indicator variables, currency exchange rates, interest rates, the Jakarta Composite Index (IHSG), and sentiment data extracted from Twitter tweets. The results indicate that sentiment analysis using the IndoBERT model achieved an accuracy of 0.69, while LSTM analysis produced the model with the smallest error for the fourth (4th) combination of variables, comprising closing price, technical indicators, IHSG, exchange rate, and Twitter sentiment, as well as the twelfth (12th) combination of variables, encompassing closing price, technical indicators, and IHSG. These combinations yielded average RMSE errors of 1.765E-04 and 1.978E-04, respectively. Following hyperparameter optimization, the best-identified model was the fourth (4th) combination of variables, yielding a minimal error of 7.580E-05 and an RMSE of 332.66 in the evaluation of test data. 


Keywords


stock, BCA, LTSM, sentiment analysis

Full Text:

PDF

References


A, M. R. G., & M, C. G. Q. (2013). Using genetic algorithm feature selection in neural classification systems for image pattern recognition. Ingeniería e Investigación, 33(1), 52–58.

Ardyanta, E. I., & Sari, H. (2021). A Prediction of Stock Price Movements Using Support Vector Machines in Indonesia. https://api.semanticscholar.org/CorpusID:244839457

Armano, G., Marchesi, M., & Murru, A. (2005). A hybrid genetic-neural architecture for stock indexes forecasting. Information Sciences, 170(1), 3–33.

Asia, B. C. (2022). Kepemilikan Saham BCA. https://www.bca.co.id/id/tentang-bca/Hubungan-Investor/Informasi-Saham/Kepemilikan-Saham-BCA

Attanasio, G., Cagliero, L., Garza, P., & Baralis, E. (2019). Combining news sentiment and technical analysis to predict stock trend reversal. 2019 International Conference on Data Mining Workshops (ICDMW), 514–521.

Bhandari, H. N., Rimal, B., Pokhrel, N. R., Rimal, R., Dahal, K. R., & Khatri, R. K. C. (2022). Predicting stock market index using LSTM. Machine Learning with Applications, 9, 100320.

Chung, H., & Shin, K. (2018). Genetic algorithm-optimized long short-term memory network for stock market prediction. Sustainability, 10(10), 3765.

Derakhshan, A., & Beigy, H. (2019). Sentiment analysis on stock social media for stock price movement prediction. Engineering Applications of Artificial Intelligence, 85, 569–578.

Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. ArXiv Preprint ArXiv:1810.04805.

Holland, J. H. (1992). Adaptation in natural and artificial systems: an introductory analysis with applications to biology, control, and artificial intelligence. MIT press.

Hu, N., Bose, I., Koh, N. S., & Liu, L. (2012). Manipulation of online reviews: An analysis of ratings, readability, and sentiments. Decision Support Systems, 52(3), 674–684.

Hur, J., Raj, M., & Riyanto, Y. E. (2006). Finance and trade: A cross-country empirical analysis on the impact of financial development and asset tangibility on international trade. World Development, 34(10), 1728–1741.

Indonesia, B. (2022). Data Suku Bunga. https://www.bi.go.id/en/statistik/indikator/bi-7day-rr.aspx

Investing.com. (2022). USD IDR Historical Data. https://www.investing.com/currencies/usd-idr-historical-data

Kara, Y., Boyacioglu, M. A., & Baykan, Ö. K. (2011). Predicting direction of stock price index movement using artificial neural networks and support vector machines: The sample of the Istanbul Stock Exchange. Expert Systems with Applications, 38(5), 5311–5319.

Kumbure, M. M., Lohrmann, C., Luukka, P., & Porras, J. (2022). Machine learning techniques and data for stock market forecasting: A literature review. Expert Systems with Applications, 197, 116659.

Luo, L., & Chen, X. (2013). Integrating piecewise linear representation and weighted support vector machine for stock trading signal prediction. Applied Soft Computing, 13(2), 806–816.

Mesquita, C. M., Oliveira, R. A. De, & Pereira, A. C. M. (2020). Combining an LSTM neural network with the Variance Ratio Test for time series prediction and operation on the Brazilian stock market. 2020 International Joint Conference on Neural Networks (IJCNN), 1–8.

Mndawe, S. T., Paul, B. S., & Doorsamy, W. (2022). Development of a stock price prediction framework for intelligent media and technical analysis. Applied Sciences, 12(2), 719.

Peng, Y., Albuquerque, P. H. M., Kimura, H., & Saavedra, C. A. P. B. (2021). Feature selection and deep neural networks for stock price direction forecasting using technical analysis indicators. Machine Learning with Applications, 5, 100060.

pypi. (2023). Snscrape python project. https://pypi.org/project/snscrape/

Schmidhuber, J., & Hochreiter, S. (1997). Long short-term memory. Neural Comput, 9(8), 1735–1780.

Shah, J., Vaidya, D., & Shah, M. (2022). A comprehensive review on multiple hybrid deep learning approaches for stock prediction. Intelligent Systems with Applications, 200111.

Sivapurapu, S. A. (2020). Comparitive Study of Time Series and Deep Learning Algorithms for Stock Price Prediction. International Journal of Advanced Computer Science and Applications, 11(6).

Sundermeyer, M., Schlüter, R., & Ney, H. (2012). LSTM neural networks for language modeling. Thirteenth Annual Conference of the International Speech Communication Association.

Wahyuddin, E. P. (2022). Pemodelan Prediksi Harga Saham Menggunakan Long-Short Term Memory: Studi Empiris pada Saham Bank Rakyat Indonesia.

Wu, S., Liu, Y., Zou, Z., & Weng, T.-H. (2022). S_I_LSTM: stock price prediction based on multiple data sources and sentiment analysis. Connection Science, 34(1), 44–62.

Yahoo. (2022). Yahoo Finance - Stock Market Live, Quotes, Business & Finance News. https://finance.yahoo.com/quote/BBCA.JK/history?p=BBCA.JK,

Yang, C., Zhai, J., & Tao, G. (2020). Deep learning for price movement prediction using convolutional neural network and long short-term memory. Mathematical Problems in Engineering, 2020.

Zheng, A., & Casari, A. (2018). Feature engineering for machine learning: principles and techniques for data scientists. “ O’Reilly Media, Inc.”




DOI: https://doi.org/10.31294/inf.v12i1.22299

Refbacks

  • There are currently no refbacks.


Copyright (c) 2025 Erna Nurmawati, Muhammad Ighfar Saputra, Rayhan Abyasa

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

Index by:

 
 Published LPPM Universitas Bina Sarana Informatika with supported by Relawan Jurnal Indonesia

Jl. Kramat Raya No.98, Kwitang, Kec. Senen, Jakarta Pusat, DKI Jakarta 10450, Indonesia
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License