Abstract
Stock trading has always been a key economic indicator in modern society and a primary source of profit for financial giants such as investment banks, quantitative trading firms, and hedge funds. Discovering the underlying patterns within the seemingly volatile yet intrinsically structured economic activities has become a central focus of research for many companies. Our study leverages widely-used modern financial forecasting algorithms, including LSTM, ANN, CNN, and BiLSTM. We begin by comparing the predictive performance of these well-known algorithms on our stock market data, utilizing metrics such as $R^2$, MAE, MSE, RMSE for detailed evaluation. Based on the performance of these models, we then aim to combine their strengths while mitigating their weaknesses, striving to construct a powerful hybrid model that overcomes the performance limitations of individual models. Through rigorous experimentation and exploration, we ultimately developed an LSTM+ANN model that breaks through prior performance bottlenecks, achieving promising and exciting results.
Introduction
Predicting stock prices is notoriously difficult due to the "noisy" nature of financial markets, where prices are influenced by a chaotic mix of historical trends, sudden news events, and macroeconomic shifts. Technically, financial data is non-stationary, meaning its statistical properties (like mean and variance) change over time.
While individual deep learning models like Long Short-Term Memory (LSTM) networks are designed to handle sequences, they often hit a performance bottleneck when faced with the sheer volatility of the market. Traditional models like ARIMA often fail to capture non-linear relationships, while complex deep models can easily overfit to noise. This research sought to break through these performance plateaus by creating a hybrid architecture that synthesizes the strengths of different modeling approaches.
Methodology
The core of the study is a Stacked Generalization (Ensemble) approach. Instead of relying on a single algorithm, the researchers built a multi-stage pipeline using base learners and a meta-learner.
Base Learners
- LSTM: A two-layer recurrent network designed to capture long-term dependencies in time-series data. The internal gates of the LSTM cell (Forget, Input, and Output gates) allow it to manage temporal information efficiently. Architecture of an LSTM cell used as a base learner in the ensemble. Source, p. 3
- ANN: A multi-layer perceptron with ReLU activation functions, used to model complex, non-linear patterns that might not be strictly sequential.
Meta-Learner and Data Engineering
The predictions from the LSTM and ANN were fed into a Linear Regression meta-learner. This layer learns how to optimally weight the output of each base learner to produce a final, more robust prediction. The study utilized a massive dataset of 860 million trading records from S&P 500 companies. Data was processed using a 30-day sliding window, median-based imputation for missing data, and MinMaxScaler normalization.
Results and Discussion
The ensemble model (LSTM + ANN) demonstrated a clear breakthrough in predictive power compared to standard benchmarks. As shown in the performance comparison, the hybrid model achieved an $R^2$ of 0.5375, significantly outperforming individual architectures.
Key Insights
- The Power of Simplicity in Ensembling: Interestingly, while the base learners are complex neural networks, the meta-learner is a simple linear regression. This suggests that the "heavy lifting" of feature extraction is done by the deep models, while the final synthesis only needs a stable, linear combination to avoid overfitting.
- The Failure of Complexity: One of the most surprising findings was that more "advanced" hybrid models, such as BiLSTM + CNN or LSTM + CNN, actually performed worse than a simple mean baseline (yielding negative $R^2$ values). This highlights a common trap in financial AI: adding more layers and complexity often leads the model to "memorize" noise rather than learn signal.
- Complementary Strengths: The success of the LSTM + ANN model stems from the fact that these architectures fail in different ways. By ensembling them, the meta-learner can compensate for the LSTM’s occasional rigidity with the ANN’s flexibility, and vice versa.
Conclusion
While the current model excels at technical analysis using price data, it does not account for qualitative external factors. Future research will focus on integrating Natural Language Processing (NLP) to perform sentiment analysis on financial news and social media feeds. Combining this "soft" data with the current "hard" price-based ensemble could further improve accuracy in volatile markets.
Summary updated