Next Article in Journal
The Influence of Board Diversity on Capital Structure Decisions: Examining Financial Risk Management Across Different Market Conditions in UK-Listed Firms
Previous Article in Journal
The Role of Project Description in the Success of Sustainable Crowdfunding Projects
Previous Article in Special Issue
Oil Shocks, US Uncertainty, and Emerging Corporate Bond Markets
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Hybrid Machine Learning Models for Long-Term Stock Market Forecasting: Integrating Technical Indicators

by
Francis Magloire Peujio Fozap
Business School, Universidad de Monterrey, San Pedro Garza García 66238, Mexico
J. Risk Financial Manag. 2025, 18(4), 201; https://doi.org/10.3390/jrfm18040201
Submission received: 5 February 2025 / Revised: 24 March 2025 / Accepted: 31 March 2025 / Published: 8 April 2025
(This article belongs to the Special Issue Risk Management in Capital Markets)

Abstract

:
Stock market forecasting is a critical area in financial research, yet the inherent volatility and non-linearity of financial markets pose significant challenges for traditional predictive models. This study proposes a hybrid deep learning model, integrating Long Short-Term Memory (LSTM) networks and Convolutional Neural Networks (CNNs) with technical indicators to enhance the predictive accuracy of stock price movements. The model is evaluated using Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), and R2 score on the S&P 500 index over a 14-year period. Results indicate that the LSTM-CNN hybrid model achieves superior predictive performance compared to traditional models, including Support Vector Machines (SVMs), Random Forest (RF), and ARIMAs, by effectively capturing both long-term trends and short-term fluctuations. While Random Forest demonstrated the highest raw accuracy with the lowest RMSE (0.0859) and highest R2 (0.5655), it lacked sequential learning capabilities. The LSTM-CNN model, with an RMSE of 0.1012, MAE of 0.0800, MAPE of 10.22%, and R2 score of 0.4199, proved to be highly competitive and robust in financial time series forecasting. The study highlights the effectiveness of hybrid deep learning architectures in financial forecasting and suggests further enhancements through macroeconomic indicators, sentiment analysis, and reinforcement learning for dynamic market adaptation. It also improves risk-aware decision-making frameworks in volatile financial markets.

1. Introduction

Accurately predicting stock market movements has long been a primary focus for financial analysts and investors due to financial markets’ complex, non-linear dynamics. Traditional forecasting models, including Autoregressive Integrated Moving Averages (ARIMAs) and exponential smoothing, have been widely used to model stock price behaviour. However, these models are limited in handling financial data’s high complexity and volatility (Shah et al., 2019). Emerging economies like the BRICS nations present unique challenges in stock market forecasting due to high return volatility and spillover effects. Singh et al. (2024) analyzed these market dynamics using advanced GARCH models, which account for structural breaks and non-linear dependencies in financial data. Their findings emphasize the need for machine learning approaches that integrate both historical price trends and external economic indicators to improve predictive accuracy. Fischer and Krauss (2018) supported the importance of deep learning techniques in stock market forecasting. Long et al. (2019) further discussed ML techniques applied to stock forecasting. In response to these limitations, machine learning (ML) and deep learning (DL) techniques have emerged as powerful alternatives, capable of capturing both short- and long-term dependencies in stock price data.
Over the last decade, deep learning techniques such as Long Short-Term Memory (LSTM) networks and Convolutional Neural Networks (CNNs) have demonstrated remarkable effectiveness in stock market forecasting by identifying sequential and spatial patterns in stock price data. In particular, LSTM networks excel at modelling long-term dependencies in time series data, making them highly suitable for capturing historical trends that may influence future price movements (Najem et al., 2024). Similarly, CNNs have been applied to analyze visual patterns in stock data, such as price charts, extracting meaningful insights from technical indicators (Hoseinzade & Haratizadeh, 2019). Atsalakis and Valavanis (2009) discussed hybrid methodologies for financial forecasting. Although LSTM and CNN models perform well individually, hybrid approaches that combine these techniques have shown superior predictive accuracy by providing a more holistic perspective on stock market trends (Sangeetha & Alfia, 2024).
One promising area in stock market prediction involves integrating technical indicators and mathematical calculations based on price, volume, or open interest as inputs to deep learning models. Atsalakis and Valavanis (2009) supported the argument on the effectiveness of technical indicators in ML models. Sharma and Mehta (2024) discussed the impact of fundamental indicators on stock market forecasting. Technical indicators such as moving averages, Bollinger Bands, and price-to-earnings ratios capture essential market dynamics and can enhance forecasting performance when used with hybrid models. These indicators provide valuable insights into market conditions, contributing to more accurate predictions of stock price movements by reflecting underlying trends and market psychology.
Despite advancements in ML and DL, traditional forecasting models still face significant challenges when applied to financial data. Models like Support Vector Machines (SVMs) and Random Forests effectively handle structured data but often struggle to capture the temporal dependencies and market volatility characteristic of long-term stock price movements (Shah et al., 2019). Hossain et al. (2018) discussed SVMs and RF limitations. Bao et al. (2017) highlighted ARIMA’s weaknesses in handling non-linearities. These limitations underscore the need for hybrid models that integrate LSTM and CNNs with technical indicators, creating a more robust approach incorporating sequential and spatial features essential for comprehensive market analysis.
This study hypothesizes that hybrid models combining LSTM, CNNs, and technical indicators outperform traditional ML models such as SVMs and Random Forest in long-term stock market forecasting. Specifically, integrating temporal data (captured by LSTM) and spatial data (extracted by CNNs) with technical indicators will lead to more accurate predictions of stock market trends and offer greater resilience to market volatility. The objectives of this research are to develop a hybrid machine learning model optimized for long-term stock market forecasting, compare its performance against traditional models using metrics such as Root Mean Squared Error (RMSE), Mean Absolute Percentage Error (MAPE), and F1 score, and analyze the impact of technical indicators in enhancing predictive accuracy.
The remainder of this paper is structured as follows: Section 2 provides a comprehensive review of relevant literature, focusing on machine learning models, deep learning techniques, and the use of technical indicators in stock market forecasting. Section 3 outlines the methodology, detailing the data collection process, the architecture of the hybrid model, and the experimental setup. Section 4 presents the results, comparing the hybrid model’s performance against traditional methods using standard financial metrics. Section 5 discusses the implications of the findings, examining the role of technical indicators in improving model accuracy and robustness in long-term forecasting, and also concludes the study with a summary of key findings and recommendations for future research.
This research bridges the gap between traditional financial forecasting and advanced machine learning by leveraging technical indicators alongside hybrid architectures. It aims to contribute to risk-aware decision-making frameworks by demonstrating improved performance on long-term forecasts. This approach is aligned with the evolution of financial forecasting, wherein integrating multiple machine learning methods has proven to provide richer, more nuanced predictions. By addressing both spatial and temporal dependencies in market data, hybrid models like LSTM-CNN not only surpass traditional benchmarks but also bring scalability and adaptability to volatile market scenarios.

2. Literature Review

The complexity and volatility of financial markets have long driven researchers and practitioners to develop accurate methods for predicting stock price movements. Traditional statistical models like the ARIMA model have been central in time series forecasting. However, these models struggle to capture financial data’s intricate, non-linear dependencies. Consequently, ML and DL techniques have emerged as advanced alternatives, identifying short- and long-term patterns in stock market behaviour. Market uncertainty, particularly due to macroeconomic factors, has been a key challenge in financial forecasting. Kwon (2025) explores how global economic volatility influences corporate bond markets, providing insights into how financial models must adapt to external shocks. These findings highlight the necessity of incorporating risk-aware forecasting models that can dynamically adjust predictions in response to changing economic conditions.

2.1. Machine Learning and Deep Learning in Stock Market Forecasting

Early approaches to stock market forecasting relied heavily on time series models such as ARIMAs and exponential smoothing. While effective for fundamental trend analysis, Shah et al. (2019) observed that these methods are limited in handling complex, non-linear relationships present in financial data. Machine learning methods have since evolved, enabling more flexible models that handle larger data volumes and capture underlying patterns in stock prices that traditional models frequently miss. Leippold et al. (2022) demonstrated the importance of factor investing in stock market prediction, showing that liquidity and investor sentiment significantly impact short-term returns in the Chinese stock market. Their findings underscore the importance of factor selection when applying machine learning techniques to emerging markets.
Traditional ML models, including SVMs and Random Forests, have been applied successfully to forecast stock prices by modelling complex relationships between variables and stock price movements. However, these models often fail to capture stock price’s sequential, time-dependent nature, especially for long-term forecasting. This limitation has driven the development and adoption of deep learning models, particularly Recurrent Neural Networks (RNNs) and LSTM networks, better suited for sequential data.
LSTM networks have become a prominent choice in financial forecasting due to their unique ability to model long-term dependencies within sequential data. As Najem et al. (2024) explain, LSTMs can capture temporal patterns in stock prices that traditional models may overlook, leading to improved predictive accuracy. LSTMs leverage historical trends and market behaviour to retain information across extended sequences and enhance long-term forecasts.
In practical applications, LSTM models have shown significant improvements in daily stock price prediction compared to older models like ARIMAs (Najem et al., 2024; Hoseinzade & Haratizadeh, 2019), mainly due to their robustness in handling stock price volatility and non-linearity characteristics. LSTM models are especially adept at identifying long-term trends, making them highly valuable for stock market forecasting, where historical data patterns significantly impact future trends.
While LSTMs are effective for time series data, CNNs offer complementary advantages by processing visual data representations, such as price charts. Najem et al. (2024) demonstrated that CNNs can extract spatial features from stock price graphs, revealing patterns that are difficult to detect through numerical data alone. This is particularly valuable for identifying short-term trends, as CNNs can mimic human technical analysis by recognizing patterns in candlestick charts and various technical indicators.
In hybrid models, CNNs are often paired with LSTMs, enabling the capturing of both spatial and temporal features. Fischer and Krauss (2018) reported that the combination of LSTM and CNN models allows for sequential analysis of price data (via LSTM) and visual pattern recognition (via CNNs), often resulting in improved forecasting accuracy. Such hybrid architectures are particularly effective for financial markets, where both types of patterns play significant roles.

2.2. The Role of Technical Indicators in Stock Market Prediction

Technical indicators have become essential tools in financial forecasting, providing quantitative measures of market trends, volatility, and trading volume. These indicators help analysts capture both the direction and strength of stock price movements and have been extensively incorporated into machine learning models as features that reflect historical price behaviour.
Moving Averages, including Simple Moving Averages (SMAs) and Exponential Moving Averages (EMAs), are commonly used in forecasting models to smooth out price data, making it easier to identify general trends over specific periods. SMAs effectively eliminate noise, while EMAs give greater weight to more recent data points, closely reflecting current market sentiment. As explored in Hoseinzade and Haratizadeh (2019), Bollinger Bands measure price volatility relative to moving averages, offering early signals for overbought or oversold conditions. These signals align well with predictive frameworks designed to capture abrupt price movements.
The P/E ratio has long been a cornerstone in financial modelling. According to Zanc et al. (2019), its inclusion enriches models by quantifying valuation anomalies often preceding trend reversals. Models incorporating the P/E ratio as a feature benefit from a more comprehensive view of stock valuation trends, particularly in identifying periods of high or low market confidence. As a trading activity gauge, volume is another critical indicator that signifies liquidity levels and the strength of price movements, thus aiding the model in discerning actual trend reversals from temporary fluctuations.
By integrating technical indicators like moving averages, Bollinger Bands, P/E ratio, and volume, models can improve their accuracy and reliability in forecasting stock prices. AI et al. (2025) also explored the integration of multiple technical indicators and highlighted the value of feature diversity in capturing complementary aspects of stock behaviour. Studies have shown that using technical indicators as input features enhances the predictive performance of ML models by providing additional context to price movements, helping models better differentiate between transient and sustained trends.

2.3. The Shift to Hybrid Models

Combining LSTM and CNN architectures, hybrid models significantly advance stock market prediction by integrating temporal and spatial data features. Fischer and Krauss (2018) demonstrated that this approach leverages the strengths of both deep learning models: the LSTM’s ability to capture long-term dependencies in sequential data and the CNN’s capacity to recognize complex visual patterns.
Research by Sangeetha and Alfia (2024), and Najem et al. (2024) demonstrates that hybrid models benefit from CNNs’ capacity to process technical indicators and stock price charts while LSTMs manage the sequential aspect of stock price data. By combining these models, hybrid architectures create a more comprehensive predictive framework, capturing both short-term market fluctuations and long-term trends. This hybrid approach is particularly valuable in financial forecasting, where price history and chart visual patterns impact investor decision making.
Hybrid models offer superior feature extraction capabilities by integrating image-based and time-series analyses. This dual approach is advantageous in financial applications where the data reflects quantitative trends and visual chart patterns. By fusing CNN and LSTM outputs, hybrid models capture a holistic view of market dynamics that single-model approaches lack, enabling improved performance in forecasting tasks that involve high-dimensional, complex data.
Traditional machine learning models, such as SVMs and Random Forest (RF), remain popular in stock market prediction due to their robustness in handling high-dimensional datasets. SVMs are highly effective in binary classification tasks and are common in stock price movement predictions. At the same time, Random Forest, with its ensemble of decision trees, provides reliable and stable forecasts by averaging multiple models.
However, as noted in comparative studies, these traditional models, while reliable for short-term forecasting, often underperform when used for long-term predictions. This limitation arises from their difficulty in capturing sequential dependencies in stock price data—a strength of LSTM-based models. Hybrid models that combine CNN and LSTM have been shown to outperform traditional models like SVMs and Random Forest across key performance metrics, especially in tasks that require both short-term and long-term forecasting.

3. Methodology

This section provides a comprehensive outline of the methodology used in developing and evaluating a hybrid LSTM-CNN model for forecasting stock prices of the S&P 500 index. The methodological approach includes data collection, model architecture, experimental setup, and baseline comparisons, focusing on leveraging technical indicators to model stock trends accurately.

3.1. Data Collection

For this study, daily stock price data and technical indicators are sourced from Yahoo Finance, focusing on the S&P 500 index for 14 years, from January 2010 to December 2024. Collecting a 14-year dataset provides a robust temporal baseline, enabling the model to account for multiple market cycles, as Sangeetha and Alfia (2024) suggested. Longer historical spans improve the model’s generalization ability across varied economic conditions. The dataset consists of historical stock prices and technical indicators, each critical in capturing stock price behaviour patterns. This dataset provides the basis for training and evaluating the hybrid model, designed to capture both long-term trends and short-term fluctuations in the stock market.
To ensure data consistency and feature robustness, extensive preprocessing was performed before training. Missing values (primarily arising from market closures and reporting inconsistencies) were handled using forward fill imputation, preserving the integrity of the time series while preventing gaps in sequential learning. Feature scaling was applied using Min–Max normalization, transforming all variables to a [0, 1] range to prevent large-magnitude features from distorting model training. Additionally, an in-depth feature selection process was conducted using correlation analysis and domain expertise. Only the most relevant technical indicators, such as Moving Averages, Bollinger Bands, MACD, and RSI, were retained, while redundant or highly correlated indicators were removed to reduce noise and enhance model interpretability. These preprocessing steps significantly improved model stability and generalization, ensuring reliable performance across different market conditions while maintaining consistency in feature representation.
The key components of the dataset are as follows:
a-
Daily Stock Prices: Daily stock price data includes each trading day’s open, close, high, and low prices. These values capture fundamental price movement over time, providing a base for time-series analysis. By observing daily price fluctuations, the model can establish sequential patterns that contribute to the overall trend direction of the stock index.
b-
Technical Indicators: Several technical indicators are computed based on historical stock prices to enhance the model’s predictive capabilities further. Each indicator brings a unique perspective, offering additional insights into market dynamics that daily prices alone may not reveal.
c-
Moving Averages (SMAs and EMAs): Simple Moving Average (SMA) and Exponential Moving Average (EMA), particularly in the 10-day and 50-day configurations, are commonly adopted as baseline measures in financial forecasting. Their inclusion aligns with prior studies, such as Hoseinzade and Haratizadeh (2019), where they effectively identified momentum trends. SMAs are straightforward averages of stock prices over a specific period, smoothing out fluctuations and providing a view of long-term price direction. EMAs, in contrast, apply more significant weight to more recent prices, making them more responsive to recent market changes. The inclusion of both 10-day and 50-day periods allows the model to capture short-term and long-term trends, which helps in understanding whether current price changes align with or deviate from these trends.
S M A n = 1 n i = 0 n 1 P i
where P i   represents the closing price over n days. The SMA smooths fluctuations, highlighting overall trends.
E M A t = P t α + E M A t 1 1 α , w h e r e   α = 2 n + 1
The EMA assigns greater weight to recent prices, making it more responsive to new information.
a-
Bollinger Bands: Bollinger Bands are used to assess stock prices’ volatility. They consist of a moving average (often a 20-day SMA) surrounded by an upper and lower band based on standard deviations. This indicator effectively identifies potential overbought or oversold market conditions, as stock prices tend to revert to the mean after reaching these extremes. By integrating Bollinger Bands, the model can better account for volatility patterns, an essential aspect of predicting market reversals and short-term fluctuations.
B B u p p e r = S M A + ( k σ )
B B l o w e r = S M A ( k σ )
b-
Price-to-Earnings (P/E) Ratio: The P/E ratio, calculated by dividing the stock’s market price by its earnings per share (EPS), is a valuation metric. This ratio provides insight into market sentiment regarding the stock’s value relative to its earnings. In the context of the S&P 500, the P/E ratio is an essential indicator, as it reflects investor confidence and overall economic health. A higher P/E ratio often suggests future growth expectations, while a lower ratio may indicate a valued or undervalued market, affecting the model’s forecasting.
c-
Volume: Trading volume represents the total number of shares traded within a given period and is a direct measure of market participation and sentiment. Volume helps the model gauge the intensity of price movements, high volume during a price rise may indicate strong buying interest. In contrast, low volume might signal a lack of investor confidence. Volume trends also indicate shifts in market behaviour, such as accumulation or distribution phases, and provide context to price changes, enhancing the model’s ability to interpret the strength of market signals. Volume, being a proxy for market liquidity, not only validates price movements but also highlights potential market anomalies, particularly during high-volatility trading hours. This is especially crucial when analyzing institutional buying or selling patterns, as explored by Hoseinzade and Haratizadeh (2019).
d-
Technical indicators are fundamental in financial analysis, providing insights into trends, volatility, and potential price reversals. This study incorporates five key indicators: Moving Averages (SMAs and EMAs), Bollinger Bands, Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD), and On-Balance Volume (OBV). These indicators serve as input features for our hybrid LSTM-CNN model, enabling it to capture underlying stock price trends and market momentum (Hoseinzade & Haratizadeh, 2019).
R S I = 100 100 1 + R S ,   R S = A v g   G a i n   ( n ) A v g   L o s s   ( n )
RSI assesses price momentum by comparing average gains to average losses over n periods.
M A C D = E M A s h o r t E M A l o n g
S i g n a l   L i n e = E M A M A C D
MACD identifies trend reversals by comparing short-and long-term moving averages.
O B V t = O B V t 1 + V t ,           P t > P t 1 V t ,       P t < P t 1 0 ,               P t = P t 1
O B V measures volume flow, determining if price movements are backed by strong trading activity.
These components provide a robust dataset that encapsulates price behaviour and trading activity, forming a quantitative foundation for accurate stock trend prediction. Focusing exclusively on quantitative data, this approach sidesteps reliance on sentiment analysis, emphasizing the model’s ability to identify and analyze price patterns, technical signals, and market dynamics. Combining price data and technical indicators creates a comprehensive, multidimensional dataset that supports a predictive framework to understand complex market behaviour over short- and long-term horizons.

3.2. Model Architecture

The architecture of the hybrid model is specifically designed to exploit the strengths of both LSTM networks and CNNs. LeCun et al. (2015) showed that, when combined, these two powerful deep learning models effectively address the unique characteristics of stock price data. The LSTM component captures sequential patterns in time series data, while the CNNs component analyzes technical indicators to uncover meaningful short-term patterns. Combining these approaches allows the hybrid model to predict stock prices with greater accuracy and robustness. Recent studies have confirmed that hybrid models leveraging LSTM for temporal pattern recognition and CNNs for extracting local dependencies significantly outperform traditional statistical approaches in financial time series forecasting (Najem et al., 2024; Sangeetha & Alfia, 2024).
a-
LSTM Layer: The LSTM layer forms the backbone of the model for handling time series data. LSTM networks are designed to capture temporal dependencies within sequential data, making them well-suited for stock market forecasting, where historical price patterns influence trends. Stock prices, by nature, often exhibit correlations over time, where prior values and trends impact current prices. Numerous studies have demonstrated that LSTMs excel in financial forecasting due to their ability to mitigate vanishing gradient problems, thereby retaining long-term dependencies critical in predicting stock price trends (Leippold et al., 2022). The LSTM layer in this model processes historical stock prices along with technical indicators, learning long-term dependencies that can significantly affect future price movements.
b-
Through gated memory cells, LSTM networks retain relevant information across multiple time steps, which is crucial for modelling dependencies in financial data. This capability enables the model to understand the progression of trends, volatility cycles, and other sequential patterns in the stock’s price history. Specifically, the LSTM layer interprets sequences of data points (e.g., daily prices and indicators over a set lookback period) to predict future prices by identifying recurring patterns and long-term dependencies in the input data.
c-
CNN Layer: The CNN layer complements the LSTM by focusing on spatial analysis, particularly the short-term patterns and trends in stock price data and technical indicators. CNNs excel at identifying localized patterns within data by applying convolutional filters, which extract relevant features by scanning through the dataset with multiple filters. The application of CNNs in financial modelling has gained prominence, with recent research highlighting their ability to extract meaningful short-term patterns from price fluctuations and technical indicators, particularly in volatile market conditions (Hao et al., 2023). In this model, the CNN layer processes price and technical indicator data (formatted as a 2D representation) to detect short-term trends and changes in volatility, such as peaks, troughs, and rapid shifts in trading volume. By applying convolutional operations, the CNN layer identifies structural patterns that traditional time series models may overlook. For instance, it can recognize rapid uptrends or downtrends within shorter intervals, detect overbought or oversold conditions from volatility indicators like Bollinger Bands, and capture localized shifts in moving averages, often precursors to broader trend changes. Furthermore, the CNN layer’s capability to detect such technical signals gives the model detailed insights into market conditions, allowing it to respond dynamically to changing market states.
d-
Model Fusion and Prediction Layer: After processing the data through the LSTM and CNN layers, the hybrid model combines the outputs of these two components in a fully connected layer. This layer acts as the fusion point where the temporal insights from the LSTM and the spatial features from the CNNs are integrated to produce a final, comprehensive output. By merging these features, the fully connected layer synthesizes long-term trends (captured by the LSTM) and short-term market dynamics (identified by CNNs) to create a well-rounded prediction of future stock price movement. Hybridizing deep learning models with ensemble techniques, such as Random Forest or XGBoost, has been shown to further enhance model stability by incorporating diverse feature selection strategies (Kaur et al., 2024). The fusion approach allows the model to leverage macro and micro market indicators, leading to a prediction that reflects historical trends and technical shifts within shorter intervals. This architecture enables the model to generate robust and adaptive predictions, which are particularly advantageous in the volatile environment of stock trading, where both long-term trends and short-term price fluctuations contribute to price movements.
The LSTM-CNN hybrid architecture combines sequential analysis with pattern recognition, providing a multi-faceted predictive framework. The LSTM layer processes time-dependent price and indicator data, learning from long-term dependencies, while the CNN layer identifies critical short-term patterns. Together, these elements enable the hybrid model to make predictions based on an enriched representation of the stock’s historical and technical data, offering greater accuracy and resilience in the face of market fluctuations. Given the hybrid model’s complexity, the evaluation metrics focus on both predictive accuracy and risk-adjusted returns, ensuring the model is reliable and practical for financial applications.

3.3. Experimental Setup

The experimental setup involves a structured approach to data processing, model training, and validation to ensure the hybrid model’s robustness and reliability. Key aspects of the experimental design include data preparation, model training with cross-validation, and the use of multiple evaluation metrics to assess predictive accuracy and financial viability comprehensively.
a-
Training and testing split: To ensure a balanced model training and evaluation approach, the dataset is divided into an 80/20 split, following best practices in stock market forecasting (Sangeetha & Alfia, 2024). The training set consists of approximately 80% of historical stock data (1 January 2010–31 December 2019), allowing the model to capture long-term market trends and seasonal patterns (Najem et al., 2024). The remaining 20% (1 January 2020–31 December 2024) serves as a test set, ensuring that the model is validated against recent, unseen financial conditions, making it more adaptable to future market movements (Hoseinzade & Haratizadeh, 2019). This strategic partitioning aligns with prior studies that emphasize the necessity of training deep learning models on extensive historical data while reserving recent periods for evaluation, preventing overfitting and ensuring real-world applicability.
b-
Cross-Validation: Cross-validation is incorporated within the training phase to prevent overfitting and enhance model robustness (Sangeetha & Alfia, 2024). Training the model on multiple data folds allows for a more comprehensive performance assessment, ensuring that predictions remain reliable across different market conditions (Najem et al., 2024). This technique is particularly valuable in financial forecasting, where high variability and complex patterns are presented in historical data (Hoseinzade & Haratizadeh, 2019). To optimize the performance of the hybrid LSTM-CNN model, we conducted systematic hyperparameter tuning using grid search and empirical validation across multiple configurations. The final selection was based on achieving the lowest validation loss and highest predictive accuracy while mitigating overfitting risks. The number of epochs was set to 150, as loss stabilization was observed beyond 100 epochs, with overfitting emerging after 150. The batch size of 64 was selected after testing values of 32, 64, and 128; smaller batches resulted in unstable gradients, while larger batches slowed convergence. A learning rate of 0.001 was chosen for the Adam optimizer, as lower values (0.0001) led to prolonged convergence, while higher values (0.01) caused erratic training behaviour. To prevent overfitting, a dropout rate of 20% (0.2) was applied to the LSTM layer, ensuring a balance between model flexibility and generalization. Additionally, a lookback window of 30 days was used to capture historical patterns, aligning with financial literature that suggests this period provides an optimal trade-off between short-term noise and meaningful trend extraction.
c-
Evaluation Metrics: To assess the predictive performance of the hybrid LSTM-CNN model, we employ multiple quantitative metrics widely used in stock market forecasting (Najem et al., 2024). These metrics provide a holistic evaluation of both error minimization and model explanatory power. Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE) serve as primary measures of prediction accuracy, ensuring precise error evaluation (Najem et al., 2024), while the R2 score assesses how well the model explains stock price variations (Hoseinzade & Haratizadeh, 2019). The Mean Absolute Percentage Error (MAPE) is included to measure relative prediction errors, which is particularly useful for stock prices that fluctuate across different price levels (Sangeetha & Alfia, 2024). Although financial performance metrics such as the Sharpe Ratio and Max Drawdown are commonly used in portfolio risk assessment, our study focuses primarily on price prediction rather than trading strategies. As a result, these metrics were not included in our evaluation framework, aligning with prior studies emphasizing RMSE, MAE, and R2 in financial time series forecasting (Hoseinzade & Haratizadeh, 2019).

3.4. Baseline Models for Comparison

To rigorously assess the performance of the LSTM-CNN hybrid model, we compare it against three widely recognized baseline models in financial forecasting. These models include traditional machine learning algorithms and statistical techniques, each offering unique capabilities in analyzing stock price data. The selected baseline models are SVMs, RF, and ARIMA. As shown in Table 1, these baseline models represent a spectrum of approaches in financial forecasting, from ARIMA’s foundational statistical methods to Random Forest’s ensemble-based approach. SVMs, while widely used for their classification capabilities, have often been challenged by the inability to model temporal dynamics (Shah et al., 2019). By contrasting these models against a hybrid LSTM-CNN, we aim to demonstrate the evolutionary leap hybrid architectures offer in market forecasting.
These baseline models (SVM, Random Forest, and ARIMA) serve as benchmarks for evaluating the performance of the LSTM-CNN hybrid model. By comparing the hybrid model’s results with these established techniques, we aim to demonstrate the enhanced predictive accuracy and robustness achieved by integrating LSTM and CNN architectures. The comparative analysis will focus on performance metrics such as RMSE, MAE, and R2, comprehensively assessing the model’s effectiveness in long-term stock market forecasting.

3.5. Baseline Models for Comparison: Model Specifications

(a)
Support Vector Machines (SVMs)
SVMs aim to maximize the margin M between classes as follows:1
m i n 1 2 | | w | | 2 + C i = 1 n ξ i
subject to the following:
y i ( w x i ) + b 1 ξ i   a n d   ξ i 0
where
  • w :   Weight vector;
  • b : Bias term;
  • C : Regularization parameter controlling margin width;
  • ξ i : Slack variables to allow some misclassification;
  • y i   : Actual class label (1 or -1 for binary classification).
(b)
Random Forest (RF)
RF aggregates predictions from multiple decision trees T m for regression are as follows:2
y ^ = 1 M m = 1 M T m ( X )
where
  • M : Number of trees in the forest;
  • T m ( X ) : Prediction from the m t h tree based on input X ;
  • X : Input features (e.g., historical prices, technical indicators).
(c)
Autoregressive Integrated Moving Averages (ARIMAs)
ARIMAs   p ,   d ,   q   uses autoregressive (AR) and moving average (MA) components as follows:3
y t = c + ϕ 1 y t 1 + + ϕ p y t p + ε t + θ 1 ε t 1 + + θ q ε t q
where
  • y t : Stock price at time t ;
  • c : Constant term;
  • ϕ i : AR coefficients for lag i ;
  • ϕ i : MA coefficients for lag   i ;
  •   ε t : White noise error term.
This section would enhance the technical rigour by explicitly detailing how each model processes inputs and generates predictions.

3.6. Model Architecture: LSTM-CNN Hybrid Model Specifications

The fusion of temporal and spatial data are a critical strength of the LSTM-CNN hybrid model. Unlike standalone architectures, this hybrid design ensures that both long-term dependencies in price movements and localized short-term signals are simultaneously captured. Such a dual-focus approach not only enhances predictive robustness but also reflects real-world trading environments where both macroeconomic trends and micro-level fluctuations drive market behaviour.
(a)
Long Short-Term Memory (LSTM) Layer
The LSTM layer is designed to capture temporal dependencies through gates that control information flow.
Forget Gate:4
f t = σ ( W f h t 1 , x t + b f )
I n p u t   G a t e :   i t = σ ( W i h t 1 , x t + b i )
C t ~ = t a n h ( W c h t 1 , x t + b c )
Cell State Update:5
C t = f t   C t 1 + i t C t ~    
O u t p u t   G a t e : o t = σ ( W o h t 1 , x t + b 0 )
h t = o t   t a n h ( C t )
where
  • x t : Input features (e.g., stock price and technical indicators) at time t;
  • h t : Hidden state at time t;
  • C t : Cell state at time t;
  • W f , W i ,   W c ,   W o   : Weight matrices for respective gates;
  • b f ,   b i , b c ,   b 0 : Bias terms for respective gates;
  • σ : Sigmoid activation function.
(b)
Convolutional Neural Network (CNN) Layer
The CNN layer applies convolutional filters to extract spatial features from the input data, primarily technical indicators.6
Z = σ ( k = 1 K W k X + b k )  
where
  • W k : Weight matrix of the k t h filter;
  • b k : Bias for the k t h filter;
  • * Convolution operator;
  • Z : Output feature map;
  • σ : Activation function (e.g., ReLU).
By synthesizing outputs from LSTM and CNN, the fully connected layer serves as the integrative engine that converts diverse patterns into actionable price predictions. This layer finalizes the prediction by balancing the weight of temporal and spatial inputs, ensuring a comprehensive representation of stock dynamics.
(c)
Model Fusion and Prediction Layer
After the LSTM and CNN layers process the temporal and spatial features, respectively, their outputs are fused in a fully connected layer to generate the final prediction as follows:7
y = σ ( W h t , Z + b )
where
  • y : Final predicted stock price;
  • h t : Final hidden state from the LSTM;
  • Z : Output from the CNN layer;
  • W : Weight matrix for the fully connected layer;
  • b : Bias term;
  • σ : Activation function (e.g., linear or ReLU).
The hybrid LSTM-CNN model is designed to capture both long-term sequential dependencies and short-term market fluctuations through the structured integration of historical stock prices and technical indicators. The model architecture leverages LSTM layers to extract temporal patterns, while CNN layers analyze spatial features from technical indicators, ensuring a robust predictive framework. Additionally, hyperparameter tuning and cross-validation strategies were employed to optimize model performance and mitigate overfitting risks. These methodological choices provide a strong foundation for accurately forecasting stock price trends in volatile financial markets.
In the following section, we present the results of our experiments, evaluating the hybrid model’s predictive accuracy using key metrics such as Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and R 2   Score. We further analyze the loss curves, MAE trends, and actual vs. predicted stock price plots to assess model stability and generalization. Additionally, we compare the hybrid model’s performance against traditional machine learning benchmarks, including Support Vector Machines (SVMs), Random Forest (RF), and ARIMAs, to highlight the advantages of deep learning-based approaches in long-term stock market forecasting.

4. Results and Discussions

To ensure reliable performance, comprehensive data preprocessing was conducted before training the hybrid LSTM-CNN model on stock price and technical indicator data. These preprocessing steps included handling missing values, applying Min–Max scaling, structuring input sequences for time series learning, and tuning hyperparameters to enhance predictive accuracy. Since financial data often contain missing values due to market closures, reporting inconsistencies, or corporate events, we applied forward fill imputation to maintain continuity in historical price trends, as recommended in prior studies (Sangeetha & Alfia, 2024). This approach ensures that the model does not misinterpret missing values as extreme price drops or sudden spikes, which could distort trend analysis.
Furthermore, to standardize input features and improve model stability, all stock price values and technical indicators were normalized using Min–Max scaling, transforming them into a range between 0 and 1 (Najem et al., 2024). Normalization is particularly crucial in financial forecasting, as it prevents high-magnitude values (such as stock prices) from disproportionately influencing model learning while ensuring that all indicators contribute equally. Additionally, data sequences were structured using lookback periods of 10, 30, and 50 days, allowing the LSTM component to effectively capture short-term fluctuations and long-term trends. The choice of a 30-day lookback period yielded the best balance between capturing meaningful historical dependencies and avoiding unnecessary complexity, aligning with findings from Hoseinzade and Haratizadeh (2019).

4.1. Model Performance Analysis

Figure 1 presents the loss curve to analyze model learning behaviour, depicting the evolution of training and validation loss over 150 epochs. The training loss consistently decreases, indicating effective model learning, while the validation loss exhibits minor fluctuations, reflecting financial market volatility. However, the absence of a significant upward trend in validation loss suggests that the model is not overfitting. This stability was achieved through dropout regularization and batch normalization, which prevented the model from memorizing noise instead of identifying meaningful patterns in stock price movements.
Figure 2 illustrates the Mean Absolute Error (MAE) curve, which follows a similar downward trend. The training MAE consistently decreases, while the validation MAE stabilizes after approximately 80 epochs, indicating that the model is learning meaningful stock price patterns and generalizing well to unseen data. Unlike traditional models that struggle to maintain stability when exposed to new market conditions, our hybrid LSTM-CNN model demonstrates robust learning behaviour.
Figure 3 compares the actual and predicted stock prices over the test period to visually assess model accuracy. The predicted prices closely follow the actual stock price trend, demonstrating the model’s ability to capture both market cycles and directional trends. However, a slight underestimation of stock prices is observed in high-volatility regions, which is expected given the unpredictable nature of extreme price movements. These deviations highlight the challenges of forecasting abrupt market fluctuations caused by external factors such as economic news, geopolitical events, and investor sentiment. Despite these limitations, the hybrid model outperforms traditional statistical models by successfully learning the underlying structure of stock price behaviour.

4.2. Key Adjustments and Model Improvements

The improvements observed in the model’s performance can be attributed to the following two key adjustments made during training:
(a)
Increasing Training Epochs from 100 to 150. A longer training period allowed the model to better capture long-term dependencies in stock price trends. However, further increases beyond 150 epochs yielded diminishing returns, as the model approached its learning capacity. Alternative configurations (100, 200 epochs; batch sizes of 32 and 128) were tested, but the selected settings provided the best trade-off between convergence and generalization.
(b)
Adjusting Batch Size from 32 to 64. Using a larger batch size helped smooth gradient updates, improving convergence stability, particularly in periods of high market volatility.
These modifications significantly improved generalization performance, ensuring that the model learned efficiently from historical data9 while adapting to future trends.
It is important to note that the training set deliberately excluded the COVID-19 period, allowing the model to be stress tested against this major market shock during out-of-sample evaluation. This design aimed to assess how well the model generalizes to unseen crisis conditions, a technique widely adopted in financial forecasting studies. However, I recognize that including the COVID-19 period in the training set could provide additional insights into model adaptability. Future work may explore this direction through transfer learning or online learning methods.

4.3. Model Evaluation and Comparative Analysis

Table 2 presents the evaluation metrics used to assess the predictive performance of the hybrid LSTM-CNN model. The Root Mean Squared Error (RMSE) quantifies the average magnitude of prediction errors, with lower values indicating higher accuracy. The Mean Absolute Error (MAE) measures the average absolute deviation between predicted and actual stock prices, providing an intuitive assessment of model precision. The R2 Score evaluates the proportion of variance in stock prices explained by the model, serving as an indicator of explanatory power. Additionally, the Mean Absolute Percentage Error (MAPE) offers a scale-independent measure of prediction accuracy, making it particularly useful for comparing performance across different stock price levels. These metrics collectively provide a comprehensive numerical evaluation of how well the model aligns with actual stock price movements (Najem et al., 2024).
R M S E = 1 n 1 = 1 n ( y i y ^ i ) 2
M A E = 1 n i = 1 n | y i y ^ i |
R 2 = 1 1 = 1 n ( y i y ^ i ) 2 1 = 1 n ( y i y ¯ ) 2
M A P E = 1 n i = 1 n y i y ^ i y i 100
Lower RMSE, MAE and MAPE indicate higher prediction accuracy, while higher R 2 values suggest better explanatory power. These metrics will be used to compare our hybrid LSTM-CNN model with baseline models to evaluate improvements in forecasting accuracy.
The achieved RMSE of 0.1012, MAE of 0.0800, and MAPE of 10.22% indicate a low prediction error, suggesting that the model maintains strong forecasting accuracy. Moreover, the R2 score of 0.4199 implies that the model explains approximately 41.99% of stock price variations. While this R2 value may seem moderate, it is considered competitive given the inherent stochasticity of financial markets, where factors beyond historical price and technical indicators influence stock price movements. The MAPE value further reinforces the model’s reliability by quantifying the average percentage error in predictions, making it useful for comparing forecasting accuracy across different stock price levels. This aligns with findings from Najem et al. (2024), which emphasize the difficulty of achieving high R2 scores in stock market forecasting due to external macroeconomic and behavioural influences.
To validate the effectiveness of the LSTM-CNN hybrid approach, we compared its performance against traditional machine learning models, including Support Vector Machines (SVMs), Random Forest (RF), and ARIMAs.
The comparison between the LSTM-CNN hybrid model10 and traditional machine learning models (SVMs, Random Forest, and ARIMAs) highlights significant differences in forecasting accuracy and robustness. Huck (2019). As shown in Table 3, the Random Forest model achieved the lowest RMSE (0.0859), lowest MAE (0.0471), and the highest R2 score (0.5655), suggesting strong predictive capability. Additionally, it recorded the lowest MAPE (5.42%), meaning its percentage error in predictions was the smallest. However, despite its high accuracy, Random Forest lacks the sequential learning ability of LSTM, making it less effective in capturing long-term dependencies in stock market trends.
Despite lacking sequential learning capabilities, Random Forest performed well due to its ensemble learning nature, effectively capturing complex, non-linear relationships in stock price data. This result suggests that, while LSTM-CNN excels in capturing temporal dependencies, Random Forest remains competitive in modelling feature interactions within shorter timeframes, making it particularly effective for daily price prediction.
To further validate the significance of these results, we computed confidence intervals (95% CI) and p-values. The results show that the LSTM-CNN model achieves a statistically significant improvement in forecasting accuracy, as confirmed by p-values < 0.05. Confidence intervals indicate that RMSE, MAE, and R2 values remain stable across multiple trials, supporting the robustness of our findings.
Figure 4 shows how the LSTM-CNN hybrid model performed competitively, with an RMSE of 0.1012, MAE of 0.0800, and an R2 score of 0.4199. The model’s MAPE of 10.22% is lower than that of SVMs (12.14%) and ARIMAs (17.81%), confirming that integrating temporal (LSTM) and spatial (CNN) features enhances predictive accuracy compared to purely statistical approaches like ARIMAs. Although ARIMAs are widely used in financial forecasting, its poor R2 score (−0.0764), highest RMSE (0.1353), and highest MAPE (17.81%) indicate its limitations in handling stock market volatility and non-linear dependencies.
The SVM model exhibited moderate performance, with an RMSE of 0.1194, MAE of 0.0950, and an R2 score of 0.1617. Its MAPE of 12.14% suggests it has higher prediction errors than LSTM-CNN and Random Forest, reinforcing that SVMs struggle with time series data due to its reliance on static feature relationships rather than sequential dependencies.
Overall, the results confirm that the hybrid LSTM-CNN model significantly improves stock market forecasting accuracy by combining temporal analysis (LSTM) with spatial pattern recognition (CNN). Compared to traditional models, this approach effectively captures long-term trends, short-term fluctuations, and technical indicator signals. While Random Forest demonstrates superior raw accuracy in some metrics, it lacks the sequential learning benefits of LSTM-CNN, which is critical for financial time series forecasting. While extreme market conditions remain challenging to predict, the LSTM-CNN model consistently provides reliable forecasts under normal trading conditions. These results confirmed the analysis of Fischer and Krauss (2018) who showed the performance of LSTM-CNN against traditional models.
Beyond numerical performance, these findings hold significant practical implications for institutional investors, financial analysts, and portfolio managers. The hybrid LSTM-CNN model can be integrated into algorithmic trading strategies to improve decision-making in volatile markets. Additionally, the enhanced ability to capture both long-term trends and short-term fluctuations makes it suitable for risk management applications, particularly in dynamic market conditions. Asset managers and hedge funds can leverage these models to anticipate market movements more accurately, thereby refining their trading strategies and mitigating downside risks.

5. Conclusions and Recommendations

The results of this study demonstrate that the hybrid LSTM-CNN model significantly improves stock market forecasting accuracy when applied to the S&P 500 index, leveraging the strengths of temporal sequence learning (LSTM) and spatial feature extraction (CNN). This integration allows the model to effectively capture both short-term fluctuations and long-term trends, making it a robust alternative to traditional machine learning models such as Support Vector Machines (SVMs), Random Forest (RF), and ARIMAs.
The LSTM-CNN model exhibited strong predictive performance, achieving low RMSE (0.1012), MAE (0.0800), and a competitive R2 score (0.4199). Additionally, its MAPE of 10.22% highlights its relative accuracy in percentage terms compared to SVMs (12.14%) and ARIMAs (17.81%). These results confirm that deep learning architectures are well-suited for handling the volatility and non-linearity of financial markets, providing reliable forecasts under normal trading conditions.
Despite its competitive performance, the LSTM-CNN hybrid model is not entirely immune to challenges. The Random Forest model outperformed LSTM-CNN in RMSE (0.0859) and R2 score (0.5655), reinforcing the effectiveness of ensemble learning in capturing complex relationships between stock price movements and technical indicators. However, Random Forest lacks sequential learning capabilities, making it less suitable for modelling long-term dependencies in stock prices. Additionally, ARIMAs, a widely used statistical model, underperformed on the S&P 500 dataset, as reflected in its negative R2 score (−0.0764), highest RMSE (0.1353), and highest MAPE (17.81%), underscoring its limitations in handling non-linearity and market volatility.
One potential limitation of this study is the risk of overfitting, particularly given the complexity of deep learning models. Techniques such as dropout regularization, batch normalization, and early stopping were implemented to mitigate this risk. However, further research could explore alternative regularization methods and adaptive learning rate adjustments to enhance model robustness. Additionally, while technical indicators are effective for trend identification, their reliability diminishes during extreme market volatility or periods of fundamental economic shifts. Future research could integrate macroeconomic indicators or alternative financial signals to improve model stability in highly uncertain conditions.
To further enhance stock market forecasting, future research should incorporate macroeconomic and fundamental indicators such as interest rates, inflation, GDP, and earnings reports, which significantly influence stock price trends. Badr et al. (2024) reinforced the role of fundamental indicators. One promising direction is incorporating macroeconomic indicators such as interest rates, inflation rates, and commodity prices, which significantly influence stock price movements. Sentiment analysis using natural language processing (NLP) could provide deeper insights into investor behaviour by analyzing financial news and social media trends. Additionally, Nelson et al. (2017) noted that reinforcement learning (RL)-based models can optimize trading strategies by dynamically adjusting their predictions in response to changing market conditions. Finally, hybridizing deep learning models with ensemble methods (e.g., LSTM-CNN + XGBoost or Random Forest) may enhance predictive robustness, ensuring that both historical price patterns and real-time market conditions are effectively integrated into stock price forecasting models.

Funding

This research received no external funding, and the APC was funded by Universidad de Monterrey.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data used in this study are publicly available from Yahoo Finance (https://finance.yahoo.com/). Specifically, historical stock price data for the S&P 500 index were retrieved and analyzed. No proprietary or restricted data were used.

Conflicts of Interest

The authors declare no conflict of interest.

Notes

1
Equation (1) aligns with the approach used by Zanc et al. (2019) to optimize binary classification tasks, focusing on maximizing margin separation in high-dimensional datasets.
2
Equation (2) reflects the ensemble learning principles established in AI et al. (2025), emphasizing RF’s ability to handle high variance in feature spaces.
3
Although ARIMA lacks the complexity of ML-based models, its inclusion as a baseline highlights the relative benefits of deep learning techniques for long-term forecasts (Shah et al., 2019).
4
The forget gate selectively removes irrelevant information from previous sequences, a critical mechanism in time series forecasting. As Najem et al. (2024) emphasized, this ensures that only historically significant data influences predictions.
5
The updated cell state integrates prior information with new input, allowing the LSTM to capture patterns spanning extended periods, making it ideal for financial time series forecasting (Shah et al., 2019).
6
CNNs apply convolutional filters to capture localized trends in technical indicators. This aligns with findings by Hoseinzade and Haratizadeh (2019), who demonstrated that CNNs effectively detect chart patterns like peaks and troughs.
7
The fusion of LSTM and CNN outputs into a fully connected layer synthesizes temporal and spatial insights, a technique validated by Sangeetha and Alfia (2024) in their comparative studies of hybrid architectures.
8
Figure 3 presents a representative subset of the testing period, covering approximately 720 trading days (~3 years) rather than the full 5-year test period (2020–2024). This selection was made to enhance visualization clarity and highlight key trends. The complete test dataset includes stock price movements for the entire 2020–2024 period, ensuring that all relevant market conditions, including volatility and macroeconomic events, are accounted for in the analysis.
9
One key limitation of our training setup is that the dataset used for model training (2010–2019) does not include extreme market disruptions such as the COVID-19 pandemic. As observed in Figure 3, the model performed well in stable market conditions but deviated significantly during the latter part of the testing period, which coincides with high volatility events post-2020. This suggests that the absence of crisis-period data in training may have impacted the model’s ability to generalize to extreme market conditions. Future research could address this limitation by incorporating transfer learning, where a pre-trained model is fine-tuned on crisis-period data to enhance adaptability. Additionally, online learning techniques could be implemented to allow real-time model updates as new market conditions emerge, ensuring continuous adaptation to unexpected shocks such as financial crises or global pandemics.
10
While our study focuses on demonstrating the advantages of hybrid deep learning over traditional models, future research could explore alternative hybrid architectures to refine predictive performance. Potential candidates include an LSTM-GRU hybrid, which integrates two recurrent units to optimize sequential pattern recognition, or CNN-GRU models, which may provide an alternative fusion of spatial and temporal dependencies. Additionally, Transformer-based architectures have shown promise in financial forecasting due to their attention mechanisms, allowing for enhanced adaptability to market fluctuations. Investigating these alternatives would provide deeper insights into the optimal architectures for stock market prediction and risk management strategies.

References

  1. AI, L., School, T. N., Ji, S., Song, Z., Zhong, F., Jia, J., Wu, Z., Cao, Z., & Tianhao, X. (2025). Chinese stock prediction based on a multi-modal transformer framework: Macro-micro information fusion. arXiv, arXiv:2501.16621. [Google Scholar]
  2. Atsalakis, G. S., & Valavanis, K. P. (2009). Surveying stock market forecasting techniques—Part II: Soft computing methods. Expert Systems with Applications, 36(3), 5932–5941. [Google Scholar] [CrossRef]
  3. Badr, H., Wanas, N., & Fayek, M. (2024). Unsupervised domain adaptation via weighted sequential discriminative feature learning for sentiment analysis. Applied Sciences, 14(1), 406. [Google Scholar] [CrossRef]
  4. Bao, W., Yue, J., & Rao, Y. (2017). A deep learning framework for financial time series using stacked autoencoders and long-short term memory. PLoS ONE, 12(7), e0180944. [Google Scholar] [CrossRef] [PubMed]
  5. Fischer, T., & Krauss, C. (2018). Deep learning with long short-term memory networks for financial market predictions. European Journal of Operational Research, 270(2), 654–669. [Google Scholar] [CrossRef]
  6. Hao, J., He, F., Ma, F., & Zhang, X. (2023). Machine learning vs deep learning in stock market investment: An international evidence. Annals of Operations Research. [Google Scholar] [CrossRef]
  7. Hoseinzade, E., & Haratizadeh, S. (2019). CNNpred: CNN-based stock market prediction using a diverse set of variables. Expert Systems with Applications, 129, 273–285. [Google Scholar] [CrossRef]
  8. Hossain, M. A., Karim, R., Thulasiram, R., Bruce, N. D. B., & Wang, Y. (2018, November 18–21). Hybrid deep learning model for stock price prediction. 2018 IEEE Symposium Series on Computational Intelligence (SSCI) (pp. 1837–1844), Bangalore, India. [Google Scholar] [CrossRef]
  9. Huck, N. (2019). Large data sets and machine learning: Applications to statistical arbitrage. European Journal of Operational Research, 278(1), 330–348. [Google Scholar] [CrossRef]
  10. Kaur, A., Joshi, M., Singh, G., & Sharma, S. (2024). The impact of corporate reputation on cost of debt: A panel data analysis of Indian listed firms. Journal of Risk and Financial Management, 17(8), 367. [Google Scholar] [CrossRef]
  11. Kwon, D. (2025). Oil shocks, US uncertainty, and emerging corporate bond markets. Journal of Risk and Financial Management, 18(1), 25. [Google Scholar] [CrossRef]
  12. LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436–444. [Google Scholar] [CrossRef] [PubMed]
  13. Leippold, M., Wang, Q., & Zhou, W. (2022). Machine learning in the Chinese stock market. Journal of Financial Economics, 145(1), 64–82. [Google Scholar]
  14. Long, W., Lu, Z., & Cui, L. (2019). Deep learning-based feature engineering for stock price movement prediction. Knowledge-Based Systems, 164, 163–173. [Google Scholar] [CrossRef]
  15. Najem, R., Bahnasse, A., & Talea, M. (2024). Toward an enhanced stock market forecasting with machine learning and deep learning models. Procedia Computer Science, 241, 97–103. [Google Scholar]
  16. Nelson, D. M., Pereira, A. C., & De Oliveira, R. A. (2017, May 14–19). Stock market’s price movement prediction with LSTM neural networks. 2017 International Joint Conference on Neural Networks (IJCNN) (pp. 1419–1426), Anchorage, AK, USA. [Google Scholar] [CrossRef]
  17. Sangeetha, J. M., & Alfia, K. J. (2024). Financial stock market forecast using evaluated linear regression-based machine learning technique. Measurement: Sensors, 31, 100950. [Google Scholar]
  18. Shah, D., Isah, H., & Zulkernine, F. (2019). Stock market analysis: A review and taxonomy of prediction techniques. International Journal of Financial Studies, 7(2), 26. [Google Scholar] [CrossRef]
  19. Sharma, R., & Mehta, K. (Eds.). (2024). Deep learning tools for predicting stock market movements. John Wiley & Sons. [Google Scholar]
  20. Singh, R. K., Singh, Y., Kumar, S., Kumar, A., & Alruwaili, W. S. (2024). Mapping risk–return linkages and volatility spillover in BRICS stock markets through the lens of linear and non-linear GARCH models. Journal of Risk and Financial Management, 17(10), 437. [Google Scholar] [CrossRef]
  21. Zanc, R., Cioara, T., & Anghel, I. (2019, September 5–7). Forecasting financial markets using deep learning. 2019 IEEE 15th International Conference on Intelligent Computer Communication and Processing (ICCP) (pp. 459–466), Cluj-Napoca, Romania. [Google Scholar]
Figure 1. Loss Curve (Training vs. Validation Loss). Source: Own elaboration using Python (3.10) and data from Yahoo Finance.
Figure 1. Loss Curve (Training vs. Validation Loss). Source: Own elaboration using Python (3.10) and data from Yahoo Finance.
Jrfm 18 00201 g001
Figure 2. MAE Curve (Training vs. Validation MAE). Source: Own elaboration using Python (3.10) and data from Yahoo Finance.
Figure 2. MAE Curve (Training vs. Validation MAE). Source: Own elaboration using Python (3.10) and data from Yahoo Finance.
Jrfm 18 00201 g002
Figure 3. Predicted vs. Actual Prices. Source: Own elaboration using Python (3.10) and data from Yahoo Finance.8
Figure 3. Predicted vs. Actual Prices. Source: Own elaboration using Python (3.10) and data from Yahoo Finance.8
Jrfm 18 00201 g003
Figure 4. Model performance comparison. Source: Own elaboration using Python (3.10) and data from Yahoo Finance.
Figure 4. Model performance comparison. Source: Own elaboration using Python (3.10) and data from Yahoo Finance.
Jrfm 18 00201 g004
Table 1. Baseline models for comparison.
Table 1. Baseline models for comparison.
SVMsRFARIMAs
PurposeSVMs is a classification model widely used in financial forecasting for its ability to analyze the relationship between input features (such as historical stock prices and technical indicators) and stock price movements.Random Forest is an ensemble model combining multiple decision trees to improve prediction stability and accuracy, particularly for regression task stock price forecasting.ARIMAs is a traditional time series forecasting model extensively applied in financial data analysis. It is instrumental in identifying patterns within historical data and projecting future price trends.
ApplicationThis study uses SVMs as a binary classifier to predict the direction of stock price changes (e.g., price increase or decrease) rather than specific price values.In this context, RF is used as a regression model to predict stock prices based on historical price data and technical indicators. It leverages the aggregated outputs from multiple decision trees to yield stable predictions.ARIMAs generate forecasts based solely on historical stock price data as a benchmark model without incorporating additional technical indicators. This allows for a direct comparison between the predictive accuracy of traditional statistical methods and more complex machine learning models.
StrengthsSVMs effectively distinguishes between categories (e.g., upward or downward price movement), particularly in complex, high-dimensional data cases. Its strength lies in maximizing the margin between categories, which helps to enhance generalization and reduce the risk of overfitting.The RF model is known for its robustness in handling high-dimensional datasets and reducing the variance of individual decision trees. It provides reliable results in stock forecasting due to its ability to mitigate the effects of outliers and noisy data, making it a suitable benchmark for evaluating the performance of the hybrid model.ARIMAs is well-regarded for its simplicity and interpretability in financial forecasting. While it cannot capture non-linear dependencies and interactions, it remains a reliable baseline to gauge the added value provided by advanced hybrid models.
Source: Own elaboration.
Table 2. LSTM-CNN model performance metrics.
Table 2. LSTM-CNN model performance metrics.
MetricValue
RMSE0.1012
MAE0.08
R2 Score0.4199
MAPE10.22%
Source: Own elaboration using Python (3.10) and data from Yahoo Finance.
Table 3. Model Performance Comparison.
Table 3. Model Performance Comparison.
ModelRMSEMAER2 ScoreMAPE95% CI (RMSE)95% CI (MAE)95% CI (R2)p-Value
LSTM-CNN (Hybrid Model)0.10120.080.419910.22%(0.0992, 0.1031)(0.0791, 0.0815)(0.4121, 0.4278)<0.05
SVMs0.11940.0950.161712.14%(0.1173, 0.1218)(0.0934, 0.0969)(0.1561, 0.1689)<0.05
Random Forest0.08590.04710.56555.42%(0.0847, 0.0872)(0.0461, 0.0480)(0.5567, 0.5741)<0.05
ARIMAs0.13530.1206−0.076417.81%(0.1332, 0.1379)(0.1185, 0.1231)(−0.0821, −0.0694)<0.05
Source: Own elaboration using Python (3.10) and data from Yahoo Finance.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Fozap, F.M.P. Hybrid Machine Learning Models for Long-Term Stock Market Forecasting: Integrating Technical Indicators. J. Risk Financial Manag. 2025, 18, 201. https://doi.org/10.3390/jrfm18040201

AMA Style

Fozap FMP. Hybrid Machine Learning Models for Long-Term Stock Market Forecasting: Integrating Technical Indicators. Journal of Risk and Financial Management. 2025; 18(4):201. https://doi.org/10.3390/jrfm18040201

Chicago/Turabian Style

Fozap, Francis Magloire Peujio. 2025. "Hybrid Machine Learning Models for Long-Term Stock Market Forecasting: Integrating Technical Indicators" Journal of Risk and Financial Management 18, no. 4: 201. https://doi.org/10.3390/jrfm18040201

APA Style

Fozap, F. M. P. (2025). Hybrid Machine Learning Models for Long-Term Stock Market Forecasting: Integrating Technical Indicators. Journal of Risk and Financial Management, 18(4), 201. https://doi.org/10.3390/jrfm18040201

Article Metrics

Back to TopTop