Abstract
This paper presents a hybrid methodology for short-term stock market trend classification, combining technical analysis with machine and deep learning. By integrating technical indicators with LSTM networks and ensemble classifiers, the study develops a pipeline to predict 7-day price trends for Amazon, Apple, Google, and Microsoft. The results demonstrate high classification accuracy (91-95%) and show how data-driven signals can refine classical stochastic models like the Barndorff-Nielsen and Shephard (BN-S) model.
Introduction
Stock market prediction is a notoriously difficult task due to high volatility and the "random walk" nature of price movements. While long-term modeling is often unrealistic, short-term forecasting provides significant value for active trading. This research addresses the gap between mathematical stochastic modeling and data-driven technical analysis by using machine learning to generate actionable signals that inform formal financial models.
Methodology
The researchers implemented a multi-stage "Predictive Pipeline" designed to capture short-term market dynamics.
Stochastic Model Refinement
The classical BN-S model was re-framed by introducing an indicator function ($\theta$). This allows the model to switch between three states—upward movement (+1), stability (0), or downward movement (-1)—based on signals generated by the data-science pipeline.
Feature Engineering and Forecasting
To avoid false signals, the study utilized four categories of technical indicators: MACD for trend, RSI and TRIX for momentum, and Bollinger Bands for volatility. A two-layer Long Short-Term Memory (LSTM) network was trained on 30 days of historical data to forecast prices for the next 7 days. These forecasts, along with the technical indicators, were then fed into a Random Forest classifier to produce final trend labels.
Data Analysis and Insights
The study utilized historical daily stock data for Amazon (AMZN), Apple (AAPL), Google (GOOGL), and Microsoft (MSFT) from 2014 to 2019 for training, with 2021 data used for validation.
Clustering Analysis
A key insight was gained through dimensionality reduction using t-SNE. This technique revealed the underlying "personality" of the different stocks based on their feature distributions.
As seen in Figure 1, Apple, Amazon, and Microsoft data naturally formed three clusters, corresponding to the three trend labels. In contrast, Google showed only two prominent clusters, suggesting its price movement was more consistently characterized by either growth or stability during the study period.
Results
The model demonstrated high precision and reliability across all four stocks:
- Classification Accuracy: The system achieved between 91.66% and 95.83% accuracy in predicting the 7-day trend.
- F1-Scores: Weighted F1-scores ranged from 0.91 to 0.95, indicating a highly robust model.
- Goodness of Fit: Statistical validation using Kolmogorov-Smirnov (KS) tests and Kullback-Leibler (KL) divergence confirmed that the predicted price distributions closely matched actual historical distributions.
Conclusion
The integration of machine learning with stochastic modeling provides a powerful framework for short-term market analysis. By leveraging technical indicators and deep learning, the proposed model successfully captures trend reversals that traditional statistical models often miss. Future work will focus on incorporating sentiment analysis from news and social media to further enhance predictive power.
Summary updated