This study evaluates the effectiveness of machine learning algorithms in predicting the stock market. Four models are used, with deep learning outperforming others. Support vector regression is ranked second in less error-prone techniques. The study aims to improve stock price prediction for retail investors using advanced machine learning algorithms like Keras Deep Neural Networks, LSTM, and linear regression. The ensemble model, which combines timeseries and deep learning models, offers substantial increases in prediction accuracy, making it a solid solution for retail investors.
Introduction
Introduction
Stock price prediction plays a crucial role in evaluating market performance and aiding investors in decision-making. Despite a wide array of global investment opportunities, forecasting remains challenging due to the noisy, nonlinear, and nonstationary nature of financial time series data.
Traditional models struggle with these complexities, prompting a shift toward machine learning (ML) approaches such as Support Vector Machines (SVM), Artificial Neural Networks (ANN), and deep learning, which better capture nonlinear dependencies in financial data.
II. Literature Survey
Recent studies emphasize the superiority of deep learning models for stock prediction:
LSTMs and deep learning outperform traditional models (Mintarya et al., 2023).
Neural networks and ensemble models like Random Forest and XGBoost show high prediction accuracy (Soni et al., 2022).
Transformers and Graph Neural Networks (GNNs) surpass LSTMs in some contexts (Zhang et al., 2023).
Deep learning models like CNNs and LSTMs demonstrate better generalization and accuracy than statistical models such as ARIMA and SVM (Gupta & Jaiswal, 2024).
III. Methodology
The methodology centers on various ML and deep learning techniques:
A. Artificial Neural Networks (ANN)
Based on McCulloch & Pitts (1943).
Commonly use backpropagation for training.
Effective in financial planning and bankruptcy prediction.
B. Support Vector Machines (SVM)
Suitable for nonstationary financial data.
SVR (Support Vector Regression) is used for price forecasting.
Utilizes risk minimization and maps data to higher-dimensional space.
C. Stock Market Prediction with Deep Learning (SMP-DL)
A two-part system: Data Preprocessing (DP) and Stock Price Prediction (SP2).
Uses models like CNNs, RNNs, and autoencoders for capturing complex market dynamics.
D. Long Short-Term Memory (LSTM)
Designed for long-term sequential data.
Addresses the vanishing gradient problem.
Different variants include BiLSTM, encoder-decoder, and CNN-LSTMs.
Hybrid Model: BiGRU-LSTM
Combines LSTM with BiGRU for enhanced temporal modeling.
Incorporates reset and update gates to improve memory and accuracy.
Uses time-aggregated data (10-min and 30-min intervals) to reduce noise.
Dropout layers are added to prevent overfitting.
IV. Results and Discussion
A. Testing the SMP-DL Framework
Dataset: IBM stock data.
Performance metrics:
MAE: 0.2099
MSE: 0.0831
Results demonstrate high accuracy and low error rates.
B. Comparative Evaluation
BiGRU-LSTM achieves:
Lowest RMSE and MAE.
Strong R² value, indicating good model fit.
Outperforms models like MLP, CNN-BiLSTM-AM, and PSO-LSTM.
Efficient in training time and epoch count (40 epochs).
Conclusion
Forecasting the stock market is crucial for financial traders, as accurate predictions can significantly influence their decisions. A smart trading platform (STP) has been developed to allow anyone to invest in stocks, futures, options, currencies, commodities, and bonds. The study demonstrated the efficacy of a hybrid model combining LSTM and BiGRU for stock market closing price forecasting. The BiGRU-LSTM hybrid model performed better than LSTM and GRU, two widely used time series analysts. The application can be used on any device with internet access, allowing investors to invest from anywhere.
References
[1] VijhM,Chandola D, Tikkiwal VA, Kumar A (2020) Stock closing price prediction using machine learning techniques .ProcediaComputSci 167:599–606
[2] Khan W, Ghazanfar M, M Azam et al (2022) Stock market prediction using machine learning classifiers and social media, news. J Ambient Intell Human Comput, Springer 13:3433–3456.
[3] Nabipour M, Nayyeri P, Jabani H, Shahab S, Mosavi A (2020) Predicting stock market trends using machine learning and deep learning algorithms via continuous and binary data; a comparative analysis.
[4] Sharma DK, Hota HS, Brown K, Handa R (2022) Integration of genetic algorithm with artificial neural network for stock market forecasting.Int J SystAssurEngManag 13(Suppl 2):828–841.
[5] Htun HH, Biehl M, Petkov N (2023) Survey of feature selection and extraction techniques for stock market prediction. Finance Innov 9(1):26
[6] Jiang W (2021) Applications of deep learning in stock market prediction: recent progress. Expert SystAppl 184:115537
[7] Soni P, Tewari Y, Krishnan D (2022) Machine Learning approaches in stock price prediction: a systematic review. In: Journal of Physics: Conference Series (Vol 2161, No. 1,p. 012065). IOP Publishing
[8] Jamous R, ALRahhal H, El-Darieby M (2021) A new ann-particle swarm optimization with center of gravity (ann-psocog) prediction model for the stock market under the effect of covid-19. Scientific Programming, 2021:1–17.
[9] Thakkar A, Chaudhari K (2021) Fusion in stock market prediction:a decade survey on the necessity, recent developments, and potential future directions. Inf Fusion 65:95–107
[10] Kumar D, Sarangi PK, Verma R (2022) A systematic review of stock market prediction using machine learning and statistical techniques. Mater Today: Proceed 49:3187–3191