Volatility in financial markets presents complex forecasting challenges for investors, particularly within emerging economies such as Indonesia. This study proposes an optimized Long Short-Term Memory (LSTM) model for forecasting the stock prices of five significant Indonesian banks: BBCA, BBRI, BMRI, BBNI, and BBTN, utilizing daily OHLCV data (Open, High, Low, Close, Volume) and technical indicators from 2020 to 2025. The dataset comprises over 6,000 daily records, segmented using a sliding window approach to preserve temporal structure and enhance learning efficiency. Concurrently, the model architecture comprising dual LSTM layers with dropout regularization was refined through systematic hyperparameter tuning to enhance predictive performance. Model evaluation employed 5-fold Time Series Cross-Validation (TSCV), a sequential validation technique that mitigates data leakage and explicitly overcomes the limitations of conventional k-fold methods by preserving chronological integrity. Performance metrics included MSE, RMSE, MAE, R², and MAPE. The experiment results demonstrate the model’s robustness in capturing long-term dependencies within financial time series. BBCA and BMRI achieved superior accuracy (R² > 0.95), with BBCA recording the lowest MAPE of 2.34%. Despite market fluctuations, the model maintained consistent reliability across all test folds. This study overcomes a methodological limitation by integrating LSTM with TSCV in expanding markets, offering actionable insights for investors, analysts, and policymakers, and serving as a reference for adaptive AI-based, more informed forecasting tools. Moreover, the proposed framework holds promise for broader application across other financial sectors and regional markets with similar volatility characteristics.