Python and LSTM neural network models and CSI 300 and CSI 500 stock index forecasts | includes AI agents, code, and data
A walkthrough of building an LSTM neural network model in Python (using Keras) to forecast the CSI 300 and CSI 500 Chinese stock indices. Covers 16 years of daily trading data (2008–2024), data preprocessing with Z-Score normalization, a single-hidden-layer LSTM architecture with 50 neurons, Adam optimizer, Dropout regularization, and RMSE/MAE evaluation. The model achieves ~2.11% MAPE on CSI 300 and ~2.41% on CSI 500, and generates 10-day forward price forecasts. The article also discusses model limitations (missing macro/sentiment features, black swan sensitivity, manual hyperparameter tuning) and improvement directions including attention mechanisms, CNN-LSTM hybrids, and ensemble learning.