Technical analysis model for stock prediction using a grammatical evolution algorithm - Aditya Kusuma Setyanegara; Imas Sukaesih Sitanggang; Mushthofa Mushthofa (IAES International Journal of Artificial Intelligence (IJ-AI), 2026)
Stocks are a popular investment instrument but carry high risks, where investors may incur losses when stocks are bought at high prices and sold at lower prices. Technical analysis is used to study past stock price behavior to predict future prices. In this study, grammatical evolution (GE) is applied as an evolutionary computing technique to discover optimal functions or programs that represent historical stock price data. This study develops GE based prediction models by utilizing objective functions and search spaces defined through grammar. The model integrates technical indicators based on complex statistical models such as autoregressive integrated moving average (ARIMA), prophet, exponential smoothing, and Fibonacci retracements. Furthermore, this study employs GE to generate ensemble weights randomly, ensuring each model contributes equitably to the final prediction formula. Experiments were conducted using multiple stock datasets, including SMAR, S&P 500, the Johannesburg Stock Exchange (JSE), the New York Stock Exchange (NYSE), and Adani Enterprises (ADANIENT), to evaluate the model’s adaptability and generalization capability. The results demonstrate that the proposed GE model effectively captures complex market patterns and produces more reliable stock price predictions compared to deep learning-based approaches. Although GE requires greater computational time, the findings suggest that GE provides a flexible and effective framework for constructing hybrid stock price forecasting models in dynamic market environments.