scieee AI-readable full text Open interactive document viewer

Real-Time Forecasting of Stock Trends using Particle Swarm Optimization

Suraj Kumar Sahu

Abstract

Abstract: The traditional neural network algorithm for stock price forecasting is prone to local optima. To enhance the accuracy of stock price forecasting and reduce forecasting time, this paper introduces an improved Particle Optimisation Neural Network Algorithm. By integrating neural networks and particle swarm optimisation algorithms, a more effective forecasting model is constructed that better reflects the dynamic changes in stock prices. Meanwhile, introducing chaos-interference and mutation factors can enhance the algorithm's diversity, thereby further improving forecast accuracy and stability. This method presents a novel solution for research and application in stock price forecasting, offering a valuable reference for relevant practitioners.

Full text

Indian Journal of Economics and Finance (IJEF) ISSN: 2582-9378 (Online), Volume-5 Issue-2, November 2025 26 Published By: Lattice Science Publication (LSP) © Copyright: All rights reserved. Retrieval Number:100.1/ijef.A262105010525 DOI:10.54105/ijef.A2621.05021125 Journal Website: www.ijef.latticescipub.com Real-Time Forecasting of Stock Trends using Particle Swarm Optimization Suraj Kumar Sahu, Zubair Ahmed Khan, Abhishek Guru, Ankita Singh Baghel, Divya Soni Abstract: The traditional neural network algorithm for stock price forecasting is prone to local optima. To enhance the accuracy of stock price forecasting and reduce forecasting time, this paper introduces an improved Particle Optimisation Neural Network Algorithm. By integrating neural networks and particle swarm optimisation algorithms, a more effective forecasting model is constructed that better reflects the dynamic changes in stock prices. Meanwhile, introducing chaos-interference and mutation factors can enhance the algorithm's diversity, thereby further improving forecast accuracy and stability. This method presents a novel solution for research and application in stock price forecasting, offering a valuable reference for relevant practitioners. Keywords: Stock Market Forecasting, Real-Time Prediction, Stock Trend Analysis, PSO, Algorithmic Trading Abbreviations: SVM: Support Vector Machines ANNs: Artificial Neural Networks LSTM: Long Short-Term Memory RNN: Recurrent Neural Network AI: Artificial Intelligence GA: Genetic Algorithm ARIMA: Autoregressive Moving Average PSO: Particle Swarm Optimization I. INTRODUCTION The traditional neural network algorithm is applied to forecasting stock prices, which can easily fall into local optima. Manuscript received on 16 April 2025 | First Revised Manuscript received on 24 April 2025 | Second Revised Manuscript received on 19 October 2025 | Manuscript Accepted on 15 November 2025 | Manuscript published on 30 November 2025. *Correspondence Author(s) Suraj Kumar Sahu*, Assistant Professor, Department of Computer Science and Engineering, Mats School of Engineering and Technology, MATS University, Raipur (Chhattisgarh), India. Email ID: [email protected], ORCID ID: 0009-0003-9679-3008 Dr. Zubair Ahmed Khan, Assistant Professor, Department of Computer Science and Engineering, Mats School of Engineering and Technology, MATS University, Raipur (Chhattisgarh), India. Email ID: [email protected], ORCID ID: 0009-0001-7003-0315 Dr. Abhishek Guru, Assistant Professor, Department of Computer Science and Engineering, Mats School of Engineering and Technology, MATS University, Raipur (Chhattisgarh), India. Email ID: [email protected], ORCID ID: 0000-0002-2479-6424 Ankita Singh Baghel, Department of Computer Science and Engineering, Mats School of Engineering and Technology, MATS University, Raipur (Chhattisgarh), India. Email ID: [email protected], ORCID ID: 0009-0003-6492-654X Divya Soni, Department of Computer Science and Engineering, Mats School of Engineering and Technology, MATS University, Raipur (Chhattisgarh), India. Email ID: [email protected], ORCID ID: 0009-0009-6143-2978 © The Authors. Published by Lattice Science Publication (LSP). This is an open-access article under the CC-BY-NC-ND license http://creativecommons.org/licenses/by-nc-nd/4.0/ To enhance the accuracy of stock price forecasting and reduce the forecasting time, this paper introduces the improved Particle Optimization Neural Network Algorithm [1]. By integrating neural networks and particle swarm optimisation algorithms, a more effective forecasting model is constructed that better reflects the dynamic changes in stock prices. Meanwhile, introducing chaos interference factors and mutation factors can increase the diversity of the algorithm, further improving the accuracy and stability of forecasting [2]. This method offers a new solution for research and application in the field of stock price forecasting, providing a valuable reference for relevant practitioners [3]. II. TRADITIONAL STATISTICAL ANALYSIS METHODS The moving average method is a fundamental smoothing technique that predicts future stock prices by averaging over a specific period. However, this method performs poorly when dealing with nonlinear trends and sudden events [4]. The formula is as follows (1): MAt =P1 + . . . +Ptt MAt =P1 + . .. +Ptt … (1) [Fig.1: Forecasting Time Consumption and Efficiency] [Fig.2: Neural Network Model Diagram] It stores information in only one direction, whereas a QR code stores it in both vertical and horizontal directions. Real-Time Forecasting of Stock Trends Using Particle Swarm Optimization 27 Published By: Lattice Science Publication (LSP) © Copyright: All rights reserved. Retrieval Number:100.1/ijef.A262105010525 DOI:10.54105/ijef.A2621.05021125 Journal Website: www.ijef.latticescipub.com III. CONCEPT PARTICLE SWARM OPTIMIZATION [Fig.3: Flow Chart of PSO Neural Network Algorithm] IV. PROPOSED METHOD The moving average method is a fundamental smoothing technique that predicts future stock prices by averaging over a specific period. However, this method performs poorly when dealing with nonlinear trends and sudden events. The formula is as follows (2): MAt =P1 + . . . +Ptt MAt =P1 + .. . +Ptt … (2) Among them, MAt represents the moving average at time t, Pt represents the stock price at the first time point, and t is the time window size for the moving average. A. Exponential Smoothing Method The exponential smoothing method is based on weighted averaging. It applies exponential weighting to historical data to predict future stock prices. However, this method fails to capture complex market fluctuations and nonlinear changes accurately. The formula is as follows (3): ESt = α ⋅ Pt +(1 − α)ESt − 1ESt = α ⋅ Pt +(1 − α)ESt − 1 … (1) ESt represents the exponential smoothing value at time t, Pt represents the stock price at time t, and α is the smoothing coefficient. B. Autoregressive Moving Average Model The Autoregressive Moving Average (ARIMA) model is a commonly used time-series analysis method that accounts for the autocorrelation and moving-average properties of data to capture trends and periodic changes in time series. However, this model requires data to be stationary and linearly related, making it inadequate for handling nonlinear relationships and complex market conditions [5]. V. APPLICATION A. Machine Learning Methods Support vector machines (SVMs) perform well in classification and regression problems and are widely applied to stock price prediction and portfolio optimisation. Kim (2003) showed that SVM outperforms traditional linear regression models in stock market prediction. Lee et al. (2020) also demonstrated that SVM effectively identifies market trends and outperforms conventional linear regression models. Decision tree models are constructed as tree structures, which are easy to interpret. Random forests enhance prediction accuracy and stability by integrating multiple decision trees (Breiman, 2001), yielding effective results in financial fraud detection and credit scoring. Liu et al. (2021) used random forest algorithms for financial fraud detection, showing high efficiency and accuracy in big data environments [6]. B. Deep Learning Methods The initial concept of artificial neural networks (ANNs) was proposed by psychologists McCulloch and Pitts in 1943, which included a mathematical model of neurons, thus opening the door to research on ANNs. Subsequently, many different neural network models emerged, but most were simple in structure and were hence called "first-generation neural network models." ANNs, by simulating biological neural networks, can handle complex nonlinear relationships. In recent years, ANNs have performed well in stock price forecasting, option pricing [7], and more (Zhang et al., 1998). Wu and Zhao (2022) used deep neural networks to predict stock market returns, finding that they outperformed traditional models at capturing market dynamics. Long shortterm memory networks (LSTMs) are a specialised type of recurrent neural network (RNN) well-suited for handling time series data. Fischer and Krauss (2023) demonstrated that LSTMs outperform traditional time-series models in stock market forecasting, effectively capturing both longand shortterm market dependencies. Ensemble learning methods combine multiple models to improve forecasting accuracy and stability [14]. C. Intelligent Optimization Algorithms With the rapid development of artificial intelligence (AI) technology, this paper examines QR Codes and how they can be composed, scanned and decoded by a camera. QR code is a dimensional barcode used for quick response in promotional and marketing purposes [10]. The paper describes how QR codes differ from barcodes, their formation, Capacity, and error correction code. Its application is in India and worldwide [12]. Telligent optimisation algorithms are increasingly used in stock price forecasting. These algorithms, by simulating human intelligence or the behavior of biological populations, and utilizing the laws of natural phenomena [11], provide new perspectives and methods for solving complex stock price forecasting problems. Intelligent optimization algorithms such as Genetic Algorithms, Particle Swarm Optimization, and Ant Colony Algorithms have been widely used in stock price forecasting optimization [13]. A Genetic Algorithm (GA) is an optimisation algorithm that simulates natural selection and genetic mechanisms, widely used in portfolio optimisation and the formulation of trading strategies. Chen et al. (2021) employed a Genetic Algorithm to optimise portfolios, resulting in significantly improved investment returns and risk management capabilities [9]. In another study, Rani et al. (2020) combined GA with Support Vector Machines Indian Journal of Economics and Finance (IJEF) ISSN: 2582-9378 (Online), Volume-5 Issue-2, November 2025 28 Published By: Lattice Science Publication (LSP) © Copyright: All rights reserved. Retrieval Number:100.1/ijef.A262105010525 DOI:10.54105/ijef.A2621.05021125 Journal Website: www.ijef.latticescipub.com (SVMs). They achieved excellent results in stock market forecasting, demonstrating the potential of the GA for multiobjective optimisation. Particle Swarm Optimisation (PSO) is an effective optimisation algorithm that simulates group behaviour for global search. Liu et al. [14] (2020) combined Particle Swarm Optimization with deep learning, improving the accuracy of financial time series forecasting. Kumar et al. (2022) used Particle Swarm Optimisation to optimise trading strategies [8], significantly enhancing returns and stability, and demonstrating its adaptability and robustness in dynamic environments [15]. VI. FORECASTING RESULTS ANALYSIS A. Algorithm Effect and Accuracy Forecasting results for stock indexes/prices using different algorithms are shown in Table 1. Experimental results indicate that the particle swarm optimization neural network algorithm achieves relatively low error values across all scenarios, making it more accurate in predicting stock prices [16]. Compared to traditional moving average methods and SWM, the PSO-based neural network method achieves higher forecasting accuracy, particularly for individual stocks such as Sg Micro Corp (300661), with accuracy exceeding 80%, demonstrating its superiority in individual stock forecasting. PSO accurately captures overall market trends, providing investors with more reliable references [17]. [Fig.4: Sigmoid Activation Function] Table 1: Forecasting Results of Index/Stock Price by Different Algorithms Index/Stock Algorithm RMSE MAE Forecasting Accuracy (%) CSI 300 Index PSO Moving Average 10.35 19.73 7.79 15.42 75.86 58.84 SVM 12.67 11.68 69.56 CSI 500 Index PSO Moving Average 12.84 20.16 9.56 15.92 75.46 57.86 SVM 13.78 14.22 64.29 Sg Micro Corp (300661) PSO Moving Average 8.68 16.27 6.82 12.33 80.57 64.12 SVM 10.83 8.09 73.58 B. Forecasting Time Consumption and Efficiency. As shown in Figure 2, the stock price forecasting based on the PSO neural network algorithm has a shorter average forecasting time compared to MA and SVM, indicating that this method exhibits higher computational efficiency in forecasting and can generate results more quickly. Additionally, it has been observed that PSO can utilise computer resources more efficiently, particularly CPU and GPU resources. [Fig.5: ReLU Activation Function] VII. CONCLUSION Numerous research methods for stock price forecasting have emerged as the economy and society have developed. Due to the ease of implementation and strong fitting ability of neural network algorithms, they have become a favourite among many experts and scholars. As a result, they hold significant potential for stock market forecasting, financial time-series analysis, and risk assessment. To date, an increasing number of intelligent algorithms have been developed to optimise artificial neural network algorithms, aiming to enhance the effectiveness of stock price forecasting. DECLARATION STATEMENT After aggregating input from all authors, I must verify the accuracy of the following information as the article's author. ▪ Conflicts of Interest/ Competing Interests: Based on my understanding, this article has no conflicts of interest. ▪ Funding Support: This article has not been funded by any organizations or agencies. This independence ensures that the research is conducted with objectivity and without any external influence. ▪ Ethical Approval and Consent to Participate: The content of this article does not necessitate ethical approval or consent to participate with supporting documentation. ▪ Data Access Statement and Material Availability: The adequate resources of this article are publicly accessible. ▪ Author's Contributions: The authorship of this article is contributed equally to all participating individuals. REFERENCES 1. Fischer, T., & Krauss, C. 2023. Long short-term memory networks for financial market prediction. Journal of Economic Dynamics and Control, 139, DOI: https://doi.org/10.1016/j.jedc.2022.104559 2. Li, F., & Xu, Y. 2023. Real-time high-frequency data analysis using the Kalman Filter. Quantitative Finance, 21(4), 567-580. DOI: Real-Time Forecasting of Stock Trends Using Particle Swarm Optimization 29 Published By: Lattice Science Publication (LSP) © Copyright: All rights reserved. Retrieval Number:100.1/ijef.A262105010525 DOI:10.54105/ijef.A2621.05021125 Journal Website: www.ijef.latticescipub.com https://doi.org/10.1155/2024/4418858 3. Kumar, R., Singh, S., & Verma, P. 2022. PSO-based trading strategy optimization. Journal of Trading Strategies, 17(2), 117-136. DOI: https://doi.org/10.1145/3696952.3696996 4. Zheng J, Zhang Z, Zou J, et al.2022. A dynamic multi-objective particle swarm optimization algorithm based on adversarial decomposition and neighbourhood evolution[J]. Swarm and Evolutionary Computation, 69: 100987. DOI: https://doi.org/10.1016/j.swevo.2021.100987 5. Bas, Eren, Erol Egrioglu, and Emine Kolemen. 2022. Training a simple recurrent deep artificial neural network for forecasting using particle swarm. Optimization. Granular Computing 7.2:411-420. DOI: http://doi.org/10.1007/s41066-021-00274-2 6. Adamu A, Abdullahi M, Junaidu S B, et al. 2021. A hybrid particle swarm optimization with crow search algorithm for feature selection[J]. Machine Learning with Applications, 6: 100108. DOI: https://doi.org/10.1016/j.mlwa.2021.100108 7. Bootkrajang J, Kabán .2021. A. Label-noise robust logistic regression and its applications[M]. Machine Learning and Knowledge Discovery in Databases. Springer Berlin Heidelberg. DOI: http://doi.org/10.1007/978-3-030-86523-8_11 8. Bento M E C. 2021. A hybrid particle swarm optimization algorithm for the wide-area damping control design[J]. IEEE Transactions on Industrial Informatics, 18(1): 592-599. DOI: http://dx.doi.org/10.1016/j.ijepes.2019.03.001 9. Lee, S., Kim, H., & Park, J. 2020. Support vector machines for stock market prediction. Expert Systems with Applications, 160, 113-129. DOI: http://dx.doi.org/10.1016/j.eswa.2009.02.038 10. Sahu, Suraj Kumar, and Sandeep Kumar Gonnade. 2013. “QR Code and Application in India.” International Journal of Recent Technology and Engineering 2 (3): 26–28. https://www.ijrte.org/wpcontent/uploads/papers/v2i3/C0692072313.pdf 11. Lohrmann C,Luukka P .2019. Classification of intraday S&P500returnswitharandomforest[J] International Journal of Forecasting,35(1):390-407. DOI: https://doi.org/10.1016/j.eswa.2015.07.002 12. Kwon O, Tseng K, Tjung L.2017. Time-series and neural network forecasts of daily stock prices [J]. Investment Management & Financial Innovations, 9(1):32-54. DOI: https://doi.org/10.1016/j.ijforecast.2018.01.002 13. Strobelt H, Gehrmann S, Huber B, et al. 2016. Visual Analysis of Hidden State Dynamics in Recurrent Neural Networks[J]. IEEE Transactions on Visualization &Computer Graphics, PP (99):1-1. DOI: http://dx.doi.org/10.1109/TVCG.2017.2744158 14. Kim M, Sayama H. Predicting stock market movements using network science: an information theoretic approach[J]. Applied Network Science, 2017, 2(1):35. DOI: https://doi.org/10.1109/TVCG.2016.2598498 15. Fama, E.F. 1970."Efficient capital markets: A review of theory and empirical work", Journal of Finance, 25:383-417. http://efinance.org.cn/cn/fm/Efficient%20Capital%20Markets%20A %20Review%20of%20Theory%20and%20Empirical%20Work.pdf 16. Rather, A. M., Agarwal, A., & Sastry, V. 2015. A recurrent neural network and a hybrid model for the prediction of stock returns. Expert Systems with Applications, 42(6),3234–3241. DOI: https://doi.org/10.2307/2325486 17. Rani, R., Gupta, S., & Kumar, V. 2020. A hybrid genetic algorithm and support vector machine for stock market prediction. Expert Systems with Applications, 44(5), 234-245. DOI: https://doi.org/10.1016/j.eswa.2014.09.016 AUTHOR’S PROFILE Mr. Suraj Kumar Sahu received an M.Tech. (CSE) degree in 2014 from MATS University, Raipur, and a PhD. Pursuing a degree from the MATS University, Raipur. He received his Bachelor's degree in Information Technology (IT) from the Government in 2011. Engineering College Jagdalpur. He has over 8 years of experience in educational institutions as an Assistant Professor in the Department of Computer Science at Jai Hind College, Mahasamund. Currently associated with the MATS SCHOOL OF ENGINEERING AND INFORMATION TECHNOLOGY, MATS UNIVERSITY RAIPUR, IN, Computer Science & Engineering Department as an Assistant Professor in the CSE department. He has published and been granted Indian and Australian patents, with some pending grants. He has published in over five journals, including International and conference proceedings. He has completed numerous FDPs, Trainings, webinars, and workshops. Proficiency in handling Teaching, Research, and administrative activities. He has made significant contributions to the literature in Network Security, Cybersecurity, and Cryptography. Dr. Zubair Ahmed Khan received a Ph.D. (CSE) in 2024 from Kalinga University, Naya Raipur. He received his M.Tech. (CSE) degree in 2018 from Mats University, Raipur, Chhattisgarh, India.HE received the RED HAT Certified Engineer 2011 RHCE & RHCA from Coss Hyderabad. He has 4 years of experience in the IT industry as a System Admin, 5+ years of experience in educational institutes as an Assistant Professor, and 2 years at Kalinga University, Naya Raipur, India, as an Assistant Professor in the Department of Computer Science Engineering. Currently, Assistant Professor with MATS SCHOOL OF ENGINEERING AND INFORMATION TECHNOLOGY, MATS UNIVERSITY RAIPUR, IN, Computer Science & Engineering Department as an Assistant Professor (HoD) in the CSE department. He has published and received grants from the Indian government; some are currently awaiting grants. He has authored and co-authored more than 10 journal articles, including those indexed in Scopus, and presented research papers at two international conferences. He has a lifetime Membership of IFERP and GALA. He has completed two FDPs, as well as Training, webinars, and workshops. Proficiency in handling Teaching, Research, and administrative activities. He has made significant contributions to the literature in Network Security, Machine Learning, Deep Learning, and IoT. Dr. Abhishek Guru received a Ph.D. (CSE) in 2021 from Kalinga University, Naya Raipur. He received his MSc degree in Computer Science (CS) in 2012 from Makhanlal Chaturvedi Rashtriya Patrakarita Vishwavidyalaya, Bhopal, India. He has 3 Months of experience in IT industry as a Software Engineer and 9+ years of experience in educational institutes as an Assistant Professor, and 2.9 years in KL Deemed To Be University, Green Fields, Vaddeswaram, India as Assistant Professor IN Department of Computer Science Engineering and currently associated with MATS SCHOOL OF ENGINEERING AND INFORMATION TECHNOLOGY, MATS UNIVERSITY RAIPUR, IN Computer Science & Engineering Department as an Associate Professor in the CSE department. He has published and been granted Indian and Australian patents, with some pending grants. He has authored and co-authored more than 10 journal articles, including those in WOS and Scopus, and presented research papers at two international conferences. He has contributed to book chapters, published by Elsevier and Springer. He has contributed to book chapters, published by Elsevier and Springer. He holds lifetime memberships with IAENG, ASR, IFERP, ICSES, the Internet Society, UACEE, IAOIP, EAI, and CSTA. He has completed many FDPs, Training, webinars & and workshops and completed the 2-week comprehensive online Patent Information Course— proficiency in handling Teaching, Research, and administrative activities. He has made significant contributions to the literature in Network Security, Cybersecurity, Cryptography, and IoT. Ankita Singh Baghel is an ambitious and confident professional pursuing a PhD in Computer Science and Engineering from MATS University, Raipur. She holds an M. Tech in Computer Science from Technocrats Institute of Technology, Bhopal (82.10%) and a B. Tech in Computer Science from LNCT, Indore (70.66%). Her academic journey is marked by consistent excellence, including top scores in her 10th and 12th grades. Ankita has established a solid technical foundation, holding certifications in C and C++, and possessing a strong working knowledge of Java, as well as proficiency in Microsoft Word, PowerPoint, and Excel. Her areas of interest include Computer Networks, Database Management Systems, and Operating Systems. She has practical experience in J2EE and SDLC, gained through her major training at Cuboid Innovates Pvt. Ltd., and completed a significant project on Data Security in Cloud Attacks. Driven by a positive attitude, a quick learning ability, and a passion for growth, Ankita is keen to contribute her skills to challenging roles in the technology sector. She is fluent in English and Hindi; her hobbies include gardening and singing. Miss Divya Soni has completed her Master of Technology (M. Tech) in Information Technology (E-Security) from 2019 to 2022 with 80%, during which she published three research papers in reputed journals, including IJIRT, IRJET, and a UGC-recognised journal. Before that, she earned her Bachelor of Engineering (B.E.) degree in Electronics and Telecommunication Indian Journal of Economics and Finance (IJEF) ISSN: 2582-9378 (Online), Volume-5 Issue-2, November 2025 30 Published By: Lattice Science Publication (LSP) © Copyright: All rights reserved. Retrieval Number:100.1/ijef.A262105010525 DOI:10.54105/ijef.A2621.05021125 Journal Website: www.ijef.latticescipub.com from the Government Engineering College (GEC) in Jagdalpur in 2018, securing a grade of 70.5%. She also qualified for the GATE examination in 2019. She is an assistant professor at MATS University, Raipur, and contributes to academic and research endeavours. Previously, she served as a Visiting Faculty member from August 2023, gaining valuable teaching experience. Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of the Lattice Science Publication (LSP)/ journal and/ or the editor(s). The Lattice Science Publication (LSP)/ journal and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions, or products referred to in the content.