Enhancing Stock Price Forecasting: Optimizing Neural Networks with Moving Average Data

Authors

    Aditiya Hermawan( 1 ) Stanley Ananda( 2 ) Junaedi( 3 )

    (1) Universitas Buddhi Dharma
    (2) Universitas Buddhi Dharma
    (3) Universitas Buddhi Dharma

DOI:


https://doi.org/10.32877/bt.v7i3.2196

Keywords:


Forecasting, Neural Network, Particle Swarm Optimization, Simple Moving Average, Stock Market

Abstract

This research focuses on optimizing a neural network model for stock price prediction using Particle Swarm Optimization (PSO), considering the inherent risks and potential high returns associated with stock investment. Given the challenges posed by stock price volatility, this study combines Moving Average (MA) a fundamental statistical technique in stock market analysis with advanced data mining approaches, specifically neural networks and PSO, to enhance prediction accuracy. The primary objective is to improve the efficiency of neural networks by minimizing error rates and equipping investors with more reliable tools for financial decision-making. The proposed methodology involves converting historical stock price data into a Simple Moving Average (SMA) over a 5-day period, followed by optimizing a neural network model using PSO. This optimization process fine-tunes key parameters, particularly the weight distributions of various stock market indicators, including Open SMA, High SMA, Low SMA, and Close SMA. Model performance is evaluated using Root Mean Square Error (RMSE) as a validation metric. The findings indicate a significant enhancement in the predictive accuracy of the neural network model after PSO optimization. The optimal configuration is identified in a two-layer neural network with a specific node arrangement. This optimized model not only improves stock price forecasting precision but also has practical implications for investors and financial analysts in risk management and profit maximization.

Downloads

References

Dini Indriyani Putri, Agung Budi Prasetijo, and Adian Fatchur Rochim, “Prediksi Harga Saham Menggunakan Metode Brown’s Weighted Exponential Moving Average dengan Optimasi Levenberg-Marquardt,” J. Nas. Tek. Elektro dan Teknol. Inf., vol. 10, no. 1, pp. 11–18, 2021, doi: 10.22146/jnteti.v10i1.678.

W. Khan, M. A. Ghazanfar, M. A. Azam, A. Karami, K. H. Alyoubi, and A. S. Alfakeeh, “Stock market prediction using machine learning classifiers and social media, news,” J. Ambient Intell. Humaniz. Comput., vol. 13, no. 7, pp. 3433–3456, 2022, doi: 10.1007/s12652-020-01839-w.

Z. A. Rafsanjani, D. Nurtiyasari, and A. Syahputra, “The Dynamics of Stock Price Change Motion Effected by Covid-19 Pandemic and the Stock Price Prediction Using Multi-layered Neural Network,” Int. J. Comput. Sci. Appl. Math., vol. 7, no. 1, p. 8, 2021, doi: 10.12962/j24775401.v7i1.7023.

B. N. Suryawati, L. Wardani, S. Sarmo, I. Kusumayadi, and M. Mutaqillah, “Prediksi Harga Saham Dengan Menggunakan Metode Moving Average,” Jmm Unram - Master Manag. J., vol. 9, no. 2, pp. 107–121, 2020, doi: 10.29303/jmm.v9i2.508.

J. Fernando, C. Stapleton, and K. Munichiello, “Moving Average (MA): Purpose, Uses, Formula, and Examples,” Investopedia.

Z. Rustam and P. Kintandani, “Application of Support Vector Regression in Indonesian Stock Price Prediction with Feature Selection Using Particle Swarm Optimisation,” Model. Simul. Eng., vol. 2019, 2019, doi: 10.1155/2019/8962717.

F. Ecer, S. Ardabili, S. S. Band, and A. Mosavi, “Training multilayer perceptron with genetic algorithms and particle swarm optimization for modeling stock price index prediction,” Entropy, vol. 22, no. 11, pp. 1–20, 2020, doi: 10.3390/e22111239.

F. Ghashami, K. Kamyar, and S. A. Riazi, “Prediction of Stock Market Index Using a Hybrid Technique of Artificial Neural Networks and Particle Swarm Optimization,” Appl. Econ. Financ., vol. 8, no. 3, p. 1, 2021, doi: 10.11114/aef.v8i3.5195.

F. Yang, J. Chen, and Y. Liu, “Improved and optimized recurrent neural network based on PSO and its application in stock price prediction,” Soft Comput., vol. 27, no. 6, pp. 3461–3476, Aug. 2021, doi: 10.1007/s00500-021-06113-5.

Y. ZHANG and S. YANG, “Prediction on the Highest Price of the Stock Based on PSO-LSTM Neural Network,” in 2019 3rd International Conference on Electronic Information Technology and Computer Engineering (EITCE), 2019, pp. 1565–1569. doi: 10.1109/EITCE47263.2019.9094982.

L. Munkhdalai, T. Munkhdalai, K. H. Park, H. G. Lee, M. Li, and K. H. Ryu, “Mixture of Activation Functions with Extended Min-Max Normalization for Forex Market Prediction,” IEEE Access, vol. 7, pp. 183680–183691, 2019, doi: 10.1109/ACCESS.2019.2959789.

S. Y. Kuo and Y. H. Chou, “Building Intelligent Moving Average-Based Stock Trading System Using Metaheuristic Algorithms,” IEEE Access, vol. 9, pp. 140383–140396, 2021, doi: 10.1109/ACCESS.2021.3119041.

P. Gao, R. Zhang, and X. Yang, “The Application of Stock Index Price Prediction with Neural Network,” Math. Comput. Appl., vol. 25, no. 3, p. 53, 2020, doi: 10.3390/mca25030053.

A. Thakkar and K. Chaudhari, “A Comprehensive Survey on Portfolio Optimization, Stock Price and Trend Prediction Using Particle Swarm Optimization,” Arch. Comput. Methods Eng., vol. 28, no. 4, pp. 2133–2164, 2021, doi: 10.1007/s11831-020-09448-8.

M. Vijh, D. Chandola, V. A. Tikkiwal, and A. Kumar, “Stock Closing Price Prediction using Machine Learning Techniques,” Procedia Comput. Sci., vol. 167, no. 2019, pp. 599–606, 2020, doi: 10.1016/j.procs.2020.03.326.

Downloads

Published

2025-04-10

How to Cite

[1]
A. Hermawan, S. Ananda, and Junaedi, “Enhancing Stock Price Forecasting: Optimizing Neural Networks with Moving Average Data”, bit-Tech, vol. 7, no. 3, pp. 798–808, Apr. 2025.

Issue

Section

Articles
DOI : https://doi.org/10.32877/bt.v7i3.2196
Abstract views: 38 / PDF downloads: 8

Most read articles by the same author(s)

1 2 > >>