Forecasting Apple Stock Prices Using LSTM, GRU, and Transformer Models: A Deep Learning Approach to Digital Market Prediction

Main Article Content

👤 Bentar Priyopradono
🏢 Teknik, Informatika, Univeritas Prof. Dr. Hazairin, SH, Bengkulu, Indonesia
👤 Dian Oktari
🏢 Faculty of Engineering, Universitas Prof. Dr. Hazairin, S.H., Indonesia

The rapid growth and volatility of digital financial markets have increased the demand for accurate, data-driven forecasting methods capable of handling complex temporal and nonlinear relationships. This study investigates the predictive performance of three deep learning architectures Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), and Transformer Encoder in forecasting Apple Inc.’s stock prices. Using historical data spanning 1980 to 2025, each model was trained on 60-day sequences to predict the next trading day’s closing price. The dataset was normalized using the MinMaxScaler and divided into 80 percent for training and 20 percent for testing. All models were trained for 20 epochs with a batch size of 32, employing the Mean Squared Error (MSE) loss function and the Adam optimizer. The results show that the GRU model achieved the best predictive accuracy, with an RMSE of 4.8281 and an MAE of 3.5578, followed by the LSTM model with an RMSE of 8.8865 and an MAE of 6.0122. The Transformer model performed less effectively, indicating its reliance on larger and more complex datasets to optimize its self-attention mechanism. Overall, the findings demonstrate that recurrent neural network-based models remain highly effective for stock price forecasting in digital financial environments. The study concludes that deep learning, particularly the GRU architecture, provides a powerful and computationally efficient framework for real-time prediction and decision-making in digital market analysis and algorithmic trading applications.

Priyopradono, B., & Oktari, D. (2026). Forecasting Apple Stock Prices Using LSTM, GRU, and Transformer Models: A Deep Learning Approach to Digital Market Prediction. Fintech Innovation Journal, 2(4), 263–279. https://doi.org/10.63913/ftij.v2i4.39

Article Details

Section
Articles

Similar Articles

<< < 1 2 3 4 > >> 

You may also start an advanced similarity search for this article.