Skip to Content
Applied SciencesApplied Sciences
  • Article
  • Open Access

7 February 2026

25 Pages

Hierarchical Attention Fused CNN-LSTM Using Structured 2D Indicator Matrices for Stock Trading Action Detection

,
,
and
1
School of Automation, Qingdao University, Qingdao 266071, China
2
Shandong Key Lab of Industrial Control Technology, Qingdao University, Qingdao 266071, China
*
Author to whom correspondence should be addressed.

Abstract

Accurate detection of trading actions (buy, sell, and hold) is critical for portfolio optimization and risk management in volatile stock markets. However, existing approaches often suffer from deficiencies in feature representation, spatiotemporal modeling, and class balancing, which limit their effectiveness. To address these issues, we propose HA-CL, a deep learning framework that integrates a hierarchical attention mechanism with CNN-LSTM. Specifically, technical indicators are encoded into a structured 2D matrix to preserve the inherent characteristics of stocks. Features extracted by ResNet are processed by a channel-wise LSTM equipped with an attention core to adaptively fuse spatial, temporal, and channel-level importance. To mitigate class imbalance, we design a customized extrema labeling strategy augmented with extrema oversampling, an importance-aware focal loss, and a heuristic action recalibration. Experiments on 63 Chinese A-share stocks show that HA-CL achieves an average accuracy of 68.89% with an annualized return of 111.01%, substantially outperforming all baselines. Risk-adjusted return metrics such as the Sharpe Ratio and the Maximum Drawdown further validate its robustness across market conditions. Together, they highlight the potential of HA-CL to translate complex market patterns into profitable trading actions.

1. Introduction

The accurate detection of trading actions in a volatile market has long been a central focus of both academic research and practical finance. In actual scenarios, the identification of actionable buying and selling points, rather than the prediction of stock prices or trends, is often more valuable and practical to maximize the portfolio returns and manage the investing risks, as these decisive moments directly influence trading strategy optimization [1]. In the literature, classical mathematical models once played a key role in time-series modeling and forecasting due to their strong interpretability [2]. However, financial data is inherently non-stationary, noisy, information-rich, and highly complex, posing significant challenges for these models [3]. With the rapid development of machine learning, data-driven approaches have increasingly supplanted traditional methods. In particular, deep learning has gained widespread attention in finance for its ability to capture nonlinear patterns and complex spatiotemporal dependencies. Motivated by these advances, this study develops a deep learning framework designed specifically to identify stock trading actions.
Deep learning has been widely applied in financial portfolio optimization [4]. A common approach employs Long Short-Term Memory (LSTM) networks; for example, an attention-enhanced LSTM for stock price prediction has been proposed [5].Additionally, Graph Convolutional Networks (GCNs) have also been incorporated into stock prediction, where [6] introduced GCNET to forecast next-day stock trends, while [7] combined an external attention module with a relational type-guided GCN to improve the stock trend prediction. Transformer-based models have also attracted attention like [8], which developed a Temporal Fusion Transformer to enhance predictive accuracy and provide tactical trading insights. In addition, reinforcement learning has also been used in trading systems; for instance, a deep Q-network (DQN)based action selection system has been proposed [9], and a new reinforcement learning network for predicting stock price trend based on a bidirectional gated recurrent unit (GRU) network has been developed to filter out some irrelevant news-level representations and capture rich long-term dependencies [10].
Despite the promise of data-driven approaches, accurately detecting trading actions in stock markets remains challenging due to data noise and class imbalance. To mitigate noise, the discrete wavelet transform (DWT) can be adopted for denoising by removing high-frequency components while preserving underlying trends [11]. Similarly, variational mode decomposition has been used in combination with LSTM models to predict financial time-series data in [12], but it is not as timely as DWT. In this work, we use a rolling-window extrema detection algorithm to identify and label extrema, which gives an interpretable basis for action prediction [13]. Prior studies [14] have shifted from stock price/trend forecasting to trading action detection. However, binary labeling fails to capture nuanced trading actions, while ternary labeling (buy, sell, and hold) usually suffers from severe class imbalance. To address this, we define a continuous action signal in [−1, 1], and discretize it into three categories: Buy Point (BP), Sell Point (SP), and Hold Point (HP) via a threshold-based scheme. This approach could alleviate class imbalance and is further enhanced by an importance-aware focal loss function.
Given the key role of technical indicators in stock market analysis, we define a structured two-dimensional (2D) indicator matrix to preserve spatiotemporal relationships among indicators, enabling richer feature extraction. Though CNN-LSTM-ResNet has employed similar image-like matrices to classify binary trading actions with some success, it is often sensitive to indicator permutations, leading to poor cross-stock generalization [14]. Our method addresses this limitation through a carefully arranged indicator layout, processed by a residual connection-enhanced Convolutional Neural Networks (CNNs) for high-level feature extraction, followed by pooling and dimensionality reduction. The resulting stacked feature maps are subsequently fed into channel-wise LSTM equipped with an attention core, where the spatial, temporal, and channel attentions are extracted and adaptively fused. The output tensor is finally classified by a fully connected (FC) layer with a softmax activation, and a heuristic action recalibration is then applied to refine the practical trading action. As a summary, the main contributions of the proposed hierarchical attention fused CNN-LSTM (HA-CL) are as follows:
  • Multi-attention core and layer-wise fusion: Inspired by CBAM in visual tasks, we propose a spatial-, temporal-, and channel-level attention core whose importance weights are level-wise fused within LSTMs to produce richer feature representations. They combine with ResNet-based CNN feature extraction to form the proposed HA-CL.
  • Action Labeling and Class Balancing: We introduce a rolling-window extrema detection to automatically identify and label trading actions, combined with extrema oversampling and an importance-aware focal loss function to mitigate the class imbalance.
  • Heuristic Action Recalibration: We propose a heuristic action recalibration algorithm to refine predicted trading actions (BPs, SPs, HPs) into actionable speculative trading actions.
The remainder of this paper is organized as follows: Section 2 reviews related works; Section 3 details the proposed methodology; Section 4 presents the experiment and analysis; and Section 5 concludes the study.

2. Related Works

This section reviews the evolution of stock modeling and forecasting, with a particular focus on recent deep learning approaches, encompassing CNN-based models, LSTM-based models, CNN-LSTM models, and CBAM-based architectures.

2.1. CNN and Its Variants

CNNs, introduced in the 1990s [15], are widely used in image-related tasks such as classification, detection, and segmentation [16,17]. In finance, CNNs have been applied to stock prediction through various feature engineering strategies. For example, the multi-channel CNN (MI-CNN), combined with maximal information coefficient feature selection, has been used to predict stock indices [18], while the N-CNN integrates large-scale data, such as news headlines, for price forecasting [19]. However, as standalone models, CNNs are limited in their ability to capture temporal dependencies. Thus, they are frequently integrated with other modules. For example, CNN-Transformer architectures have been employed for single- and multi-step stock predictions, achieving error reductions of 45%, 32%, and 36.8% compared to LSTM, attention-based LSTM, and Transformer models, respectively [20].

2.2. LSTM and Its Variants

Recurrent Neural Networks (RNNs), introduced in the 1980s, were designed to model short-term sequential dependencies [21] but suffered from the vanishing gradient problem when handling long-term sequences [22]. LSTM networks [23] addressed this limitation by introducing input, forget, and output gates, thus enabling long-term sequential dependency learning. The GRU further simplified the architecture with update and reset gates [24]. MCI-GRU, a new model for stock prediction based on a multi-head cross attention mechanism and an improved GRU, was proposed [25].Extensions such as Bidirectional LSTM (BiLSTM) [26] improved context capture and sequence decomposition. Recent advances include AB-ConvLSTM for large-scale flow-velocity prediction [27] and earthquake prediction using the EGA-LSTM model [28]. In financial applications, LSTM and its variants have been widely used for stock forecasting and trading signal generation based on raw prices or technical indicators [29,30]. Further developments include the LSTM-BO-LightGBM model for stock price volatility prediction [31] and the IGWO-MALSTM model for Financial Time Series Forecasting [32]. However, LSTM architectures are inherently limited to temporal modeling and struggle to extract higher-level interactions between features.

2.3. CNN-LSTM-Based Models

In time-series analysis, CNNs demonstrate superior efficacy in extracting localized patterns, while LSTMs capture long-term dependencies. Their hybrid models have shown strong performance in financial forecasting. For example, CNN-LSTM was used to predict gold prices [33], and a CNN with a sliding-window mechanism was applied for short-term stock trend prediction [34].More advanced hybrids, such as CNN-BiLSTM-Attention [35], achieved state-of-the-art results on the CSI 300 Index, and MDT-CNN-LSTM [36] was used to predict cross-index feature correlations. CNN-LSTM, GRU-CNN, and ensemble models [37] are used to predict the closing prices of stock indices at single- and multi-step time horizons. However, these models are primarily for price prediction rather than for predicting direct trading actions. Since action-based forecasting can be more operationally effective, especially when combined with attention mechanisms, this paper addresses the stock trading action prediction problem under class imbalance.

2.4. CBAM-Based Models

Attention mechanisms enable models to dynamically focus on the most relevant features, enhancing model performance and interpretability on structured or sequential data. The Convolutional Block Attention Module (CBAM) [38] was originally designed to improve CNN feature representations by sequentially applying channel attention and spatial attention, with the former emphasizing informative channels and the latter highlighting salient spatial regions. CBAM has been successfully applied in various domains, such as multimodal sentiment analysis [39] and remote sensing [40]. In finance, CBAM has been integrated into CNN-LSTM architectures for stock price prediction [41], such as CNN-CBAM-LSTM for the Australian Standard & Poor’s 200 Index (AS51) [42], and Multi-channel-VMD-CBAM5-BiLSTM (MVC5B) models [43] for index forecasting. However, most implementations treat CBAM as a preprocessing or auxiliary enhancement module, rather than embedding it into an end-to-end trading action prediction framework. In contrast, our method introduces a fine-grained attention core to dynamically capture the importance of spatial, temporal, and channel attentions, which are then adaptively fused into a highly discriminative feature map, to improve both model interpretability and performance in trading action prediction.

3. Methodology

This section describes the model architecture and design principles of the proposed HA-CL. Since the input representation is closely linked to the model framework, we begin by constructing a structured indicator matrix. Details of data collection, action labeling, and class balancing are provided in Section 4.1. We then present the model architecture, followed by an action recalibration for its predicted trading action refinement.

3.1. Structured Indicator Matrix

Market indicators are widely used in stock prediction. For instance, MACD and RSI have been applied to predict short-term average prices [44]; technical indicators have been shown to influence cross-sectional returns [45]; incorporating indicators such as CCI, ADX, WILL, ATR, TR, and MFR improves CNN prediction performance [46]; and technical indicators such as EMA and ATR were employed to investigate the optimal output window length for enhancing the accuracy of future stock price trend forecasting [47]; and relationships between corporate stocks and measures such as TP and RSI have been investigated [48]. Other studies have examined decision-making mechanisms involving KDJ and similar market signals [49]. These features are widely recognized in financial forecasting. Therefore, the proposed model employs a structured two-dimensional matrix as input, which is constructed from a comprehensive set of technical indicators (as shown in Table 1) derived from raw stock exchange data. These indicators include both those established in [14] and others closely related to the labels, such as MFR, CCI, PSY, +DI, and −DI. The indicators are grouped into functional categories:
Table 1. Structured Indicator Matrix.
  • Price-based indicators (Close, ATP, ALT, PCCP): Capture price levels and volatility, reflecting the magnitude of daily price fluctuations and overall market activity.
  • Volume-based indicators (Volume, TURN, CTR, PCTV): Measure trading activity and capital inflows/outflows.
  • Trend indicators (RDMA, RMACD, MACD, BIAS): Identify trend direction and generate buy/sell signals across multiple timeframes.
  • Momentum and oscillator indicators (RSI, WILL, K, D, J, PSY, CCI, CTM): Assess price momentum and the relative strength of buying/selling forces.
  • Volume–price momentum indicators (MFI, CATP): Gauge capital flow intensity and confirm or contradict trend signals.
  • Directional movement indicators (+DI, −DI): Differentiate between rising and falling momentum, assessing trend strength.
  • Pattern-based indicators (ITL): Capture candlestick and K-line patterns to enhance decision accuracy.

3.2. HA-CL

In our framework, the selected indicators are arranged into a structured 30 × 30 matrix that preserves the spatial and temporal relationships among features. All elements are column-normalized to ensure numerical stability and scale consistency across inputs [50]. Detailed definitions of technical indicators are provided in the Appendix A.
As shown in Figure 1, HA-CL consists of two main components, an informative feature extraction module and a hierarchical attention-based LSTM module (HA-LSTM). The former module processes the 30 × 30 input matrix in Section 3.1 to extract salient patterns and reduces dimensionality to 15 × 15 × 3. The resulting features are fed into the latter module and subsequently passed through an FC layer with 128 hidden neurons to produce a three-class classification output. It is worth noting that class imbalance is common in stock trading action labeling, as HPs are much more frequent than BPs+SPs in stock trading. We will introduce our balancing strategy, which uses oversampling and an importance-aware focal loss function. In summary, the proposed model enables end-to-end trading action prediction and identifies key spatial, temporal, and channel-wise feature importance via an adaptive attention core.
Figure 1. Model architecture of HA-CL.

3.2.1. Informative Feature Extraction

The model takes a structured 30 × 30 matrix as input and applies 32 3 × 3 convolutional kernels with residual connections to produce a 32-channel 30 × 30 feature map, with edge padding applied to preserve spatial resolution. This output is subsequently downsampled through a 2 × 2 max-pooling layer with a stride of 2, resulting in a 15 × 15 × 32 tensor. To mitigate computational overhead and reduce redundancy, a 1 × 1 convolution is applied to compress the feature dimension to 15 × 15 × 3 (see Section 5). The reduced feature tensor is then passed into the HA-LSTM module.

3.2.2. HA-LSTM

To emphasize the most informative features across spatial, temporal, and channels, we adopt an attention core, as shown in Figure 1. Specifically, the channel attention module (CAM) is formulated as
Z a v g c = 1 F · W ∑ i   =   1 F ∑ j   =   1 W X i , j , :
Z m a x c = max i   =   1 , … , F max j   =   1 , … , W X i , j , :
C A M = σ W 2 δ W 1 Z a v g c + W 2 δ W 1 Z m a x c
where X ∈ R F × W × C is the resulting feature map in the last module, F, W, and C are the number of rows, columns, and channels of the informative feature extraction output, representing the number of features, time steps, and independent channels. Z a v g c and Z m a x c are channel-wise average pooling and max pooling, respectively. σ and δ are the sigmoid and ReLU activation functions [51]. W 1 ∈ R C r × C and W 2 ∈ R C × C r are layer weights with a reduction ratio r for dimensionality compression.
The temporal attention module (TAM) and spatial attention module (SAM) are formulated as
Z a v g s = 1 C ∑ z   =   1 C X : , : , z
Z m a x s = max i   =   1 , … , C X : , : , z
S A = σ C o n v 3 × 3 Z a v g s + C o n v 3 × 3 Z m a x s
S A M i , j = e x p S A i , j ∑ i = 1 F e x p S A i , j
T A M j = s o f t m a x 1 F ∑ i   =   1 F S A i , j
where Z a v g s and Z m a x s represent cross-channel average pooling and maximum pooling, respectively. S A ∈ R F × W is the spatial attention map, S A i , j is the element of row i, column j of S A .
As shown in Figure 2, the LSTM fuses SAM into its inputs through
x ˜ t = x t ⊗ S A M : , t + x t
followed by standard LSTM gating operations as
i t = σ ω h i h t − 1 + ω i i x ˜ t + b i )
f t = σ ω h f h t − 1 + ω i f x ˜ t + b f )
o t = σ ω h o h t − 1 + ω i o x ˜ t + b o )
g t = t a n h ω h g h t − 1 + ω i g x ˜ t + b g )
C t = f t ⊗ C t − 1 + i t ⊗ g t
h t = t a n h C t ⊗ o t
TAM fuses hidden outputs as
O i = T A M ⊗ H ⊤
and CAM weights the channel outputs as
O u t p u t = C A M ⊗ O
where x ˜ t is the input to the channel-wise LSTM module, augmented with its original input and SAM in the Residual Connection. h t is the hidden state, ⊗ denotes element-by-element multiplication, and  C t is the memory cell vector. i t , o t , f t , and  g t are the state of input, output, forget gates, and update gates. ω h i , ω h f , ω h o , and  ω h g are the weight matrices of the previous hidden layer, while ω i i , ω i f , ω i o , and  ω i g are the weight matrices for input enhancement, and  b i , b f , b o , and  b g are the bias vectors. O i represents the output of the i-th channel-wise LSTM, i = 1 , 2 , 3 , H ⊤ = [ h 1 , h 2 , … , h 15 ] is the hidden state vector. O is the feature map after TAM fusion.
Figure 2. Architecture of our attention LSTM.
The HA-LSTM comprises three parallel LSTMs, each processing one channel independently with 128 hidden units. Their concatenated output (1 × 384) passes through an FC layer with 64 neurons and a GELU activation, yielding class probabilities. The predicted category Y t is determined by selecting the class with the highest probability.

3.2.3. Importance-Aware Focal Loss Function

In imbalanced classification tasks, the focal loss function is commonly employed to reduce the relative contribution of well-classified samples and emphasize harder ones. However, in our case, local extreme points are labeled as BP and SP, while HP occur at a frequency several hundred times greater. Under such extreme imbalance, focal loss alone is insufficient to mitigate the problem. To address this issue, we apply label oversampling (see Section 4.1) and further improve the focal loss function with importance-aware weighting. This strategy permits intentional overfitting of BP and SP samples while still leveraging their true information. The importance coefficient s t is defined as
s t = A t − λ 1 − λ , if A t ≥ λ − A t − λ 1 − λ , if A t ≤ − λ 1 − A t λ , if − λ < A t < λ
where A t denotes the continuous action value. λ is experimentally set to 0.9, where a larger value fails to alleviate class imbalance, while a smaller value could introduce noisy or confusing information. This setting assigns higher importance to samples near BP and SP. Based on this coefficient, the proposed importance-aware focal loss function is formulated as
L = − 1 N ∑ i = 1 N ( 0.001 + s i ) · w y i · 1 − p i 2 · log p i )
where N is the total number of samples, and  w y i is the hard weight vector for label y i , set to 1 , 2 , 1 ⊤ in this study. p i = ∑ j = 1 3 S j · p i j represents the predicted probability for the i-th sample, where S j is the one-hot encoded true label, and  p i j is the predicted probability of class j.

3.3. Action Recalibration

In this section, due to the specific model architecture and loss function of the proposed method, its output is a range that contains precise action points. Accordingly, we propose a trading action recalibration strategy to derive more reliable speculative trading points from the oversampled model predictions. To prevent introducing future information and ensure consistency with actual stock trading, we utilize the last five minutes of intraday data rather than the daily closing price, which was overlooked in [14]. Based on this, we define two indicators as
c r t = c l o s e 5 t − c l o s e 5 t − 1 c l o s e 5 t − 1
p c r t = c l o s e 5 t − 1 − c l o s e 5 t − 2 c l o s e 5 t − 2
where c l o s e 5 ( t ) denotes the closing price five minutes before the market closes on day t. c r ( t ) represents the relative change rate of c l o s e 5 ( t ) in [14], and  p c r ( t ) represents the relative change rate of c l o s e 5 ( t − 1 ) . These indicators are used jointly to capture price trends and turning points.
When the prediction corresponds to a BP ( Y t = 1 ), the most valuable trading signals appear as a continuous decline or a decline followed by an increase, with  p c r ( t ) < 0 . The recalibrated action is thus defined as
S t = 1 , ( c r ( t ) − p c r ( t ) > 0.04 ) ∩ ( c r ( t ) < − 0.01 ) ∩ 1 2 p c r ( t ) < c r ( t ) < 1 6 p c r ( t ) 1 , ( c r ( t ) > 0.005 ) ∩ ( c r ( t ) − p c r ( t ) > 0.03 ) 0 , otherwise
Similarly, when the prediction corresponds to an SP ( Y t = − 1 ), the most valuable trading signals appear as a continuous increase or an increase followed by a decline, with  p c r ( t ) > 0 . The recalibrated action is thus defined as
S t = − 1 , ( c r ( t ) − p c r ( t ) < − 0.04 ) ∩ ( c r ( t ) > 0.01 ) ∩ 1 2 p c r ( t ) > c r ( t ) > 1 6 p c r ( t ) − 1 , ( c r ( t ) < − 0.005 ) ∩ ( c r ( t ) − p c r ( t ) < − 0.03 ) 0 , otherwise
Otherwise, the corresponding prediction is set to S t = 0 . It is important to note that the thresholds (0.04, 0.01, 0.005, 0.03) and scaling parameters (1/2, 1/6) are determined as follows: A grid search is performed on the parameter space on the training set, with the Sharpe ratio of the final portfolio as the optimization objective. This process is a data-driven method that seeks the optimal balance between signal sensitivity and signal quality.
As summarized in Algorithm 1, the proposed trading algorithm is tailored to the Chinese A-share market, which executes trades and calculates returns for each test, adhering to a T + 1 transaction execution to comply with market restrictions. Both buying and selling are limited to lots of 100 shares, and transaction costs are incorporated into the simulation. To ensure validity, the algorithm is carefully designed to prevent any inadvertent use of future information in action prediction.
Algorithm 1 Trade Execution and Return Calculation
Require: cb = 0.01
Require: cs = 0.01
Require: Money(0) = 100,000
Require: Share(0) = 0
Require: Value(0) = 0
  1:
for  t = 1 to T do
  2:
Stock(t) ← B u y M o n e y ( t ) p c ( t ) · ( 1 + c b ) · 100 · 100
  3:
if  S t = 0 then
  4:
Money(t) = Money(t − 1)
  5:
Share(t) = Share(t − 1)
  6:
Value(t) = Share(t) · p c ( t ) + BuyMoney(t)
  7:
else if  S t = 1 then
  8:
Money(t) = Money(t − 1) − Stock(t) · p c ( t ) · (1 + cb)
  9:
Share(t)= Share(t − 1) + Stock(t)
10:
Value(t) = Share(t) · p c ( t ) + Money(t)
11:
else if  S t = −1 then
12:
SellShares = S h a r e N u m b e r ( t − 1 ) 100 · 100
13:
if SellShares > 0 then
14:
Money(t) = Money(t − 1) + SellShares · p c ( t ) · ( 1 − c s )
15:
Share(t) = Share(t − 1) − SellShares
16:
Value(t) = Share(t) · p c ( t ) + Money(t)
17:
else
18:
Money(t) = Money(t − 1)
19:
Share(t) = Share(t − 1)
20:
Value(t) = Share(t) · p c ( t ) + Money(t)
21:
end if
22:
end if
23:
end for

4. Experiment

4.1. Data Collection, Action Labeling, and Class Balancing

To evaluate the proposed model, we collect both daily and minute-level data from A-shares listed on the Main Board of the Shanghai Stock Exchange and the SME Board of the Shenzhen Stock Exchange. The dataset spans from 28 April 2009 to 1 October 2024, and includes key indicators such as opening, closing, high, and low prices, trading volume, turnover rate, and transaction amount. All data were retrieved using the baostock Python package (version 0.8.9). To ensure data quality, 63 stocks were retained for evaluation based on a fine-grained screening of trading volume and trading day. Each stock was divided into training (80%), validation (10%), and testing (10%) sets. As shown in Figure 3, the experiment used 5-fold time-series cross-validation, maintaining the strict time order of the training and validation sets in each fold to avoid forward bias. Then, we used the validation subset for hyperparameter tuning and early stopping, averaging across all validation sets to select the best-performing model configuration, and then measuring its performance on the out-of-sample test set. The final 300 trading days in the testing set were reserved to assess the financial performance of the proposed model.
Figure 3. Increasing window cross-validation considering a 5-fold time series splitting method.
In this study, the labeling of trading actions is based on each stock’s closing price. First, the closing prices are smoothed using DWT. Subsequently, a rolling-window labeling method is applied to detect local extrema. As illustrated in Algorithm 2, the window size was optimized to 7 via trial and error. Alternating maximum and minimum sequences are refined through two iterations to ensure that no additional maxima (or minima) exist between adjacent extrema. Based on this sequence, we compute the continuous action value A t for each closing price c l o s e t by considering the nearest extrema p 1 (past) and p 2 (future) and define it as
A t = m − c l o s e t m − p 1 , c l o s e t < m m − c l o s e t p 2 − m , c l o s e t > m
where m = ( p 1 + p 2 ) / 2 , p 1 and p 2 are the most recent past and future extreme points at time t, respectively.
Algorithm 2 Extrema Detection
  1:
for  t = 1 to T do
  2:
Window = c l o s e [ t − w i n d o w : t + w i n d o w − 1 ]
  3:
if close(t) < min (Window) then
  4:
max list. append ( t )
  5:
else if close(t) > min (Window) then
  6:
min list. append ( t )
  7:
end if
  8:
end for
  9:
for  i t e r = 1 to 2 do
10:
for  i = 0 to len(max list) − 2 do
11:
start = max list[i]
12:
end = max list[i + 1]
13:
min point = arg min (close[start:end + 1])
14:
refined min list.append(start + min_point)
15:
end for
16:
for  i = 0 to len(min list) − 2 do
17:
start = min list[i]
18:
end = min list[i + 1]
19:
max point = arg max (close[start:end + 1])
20:
refined max list.append(start + max point)
21:
end for
22:
max list = refined max list
23:
min list = refined min list
24:
end for
25:
extrema list = concat(max list, min list)
To address class imbalance, we extend the labeling near the extrema. Specifically, points near local maxima SP and minima BP are marked as SPs or HPs according to a threshold applied to A t , while points near HPs are undersampled. The action labeling is defined as
S t = 1 , A t > 0.9 − 1 , A t < 0.9 0 , o t h e r w i s e
where S t denotes the labeled trading action after class balancing. This procedure increases the number of trading points by approximately threefold, alleviating the severe class imbalance in raw data and working in conjunction with the designed importance-aware focal loss function.

4.2. Experimental Setup and Evaluation Metrics

4.2.1. Setup

The proposed model was implemented in PyTorch (version 1.13.1+cu116) and executed on an NVIDIA GeForce RTX 3090 GPU, paired with an Intel® Xeon® Silver 4210 CPU @ 2.20 GHz (single-socket configuration with 20 logical cores), running on Windows 10. The key hyperparameters are as follows: 100 training epochs, an early stopping patience of 20, a batch size of 512, weight decay of 0.001, and an initial learning rate of 0.001. To address the class imbalance, we employ an importance-aware focal loss function. Additional model and data-related parameters are summarized in Table 2, and the activation functions for each layer are shown in the workflow diagram. These hyperparameter choices are informed by prior literature and refined through extensive empirical experimentation. In this experiment, the random seed settings were set to 42. Furthermore, we used grid search and cross-validation folds to find the optimal values for the following parameters on the grid [52]:
Table 2. Hyperparameters in this study.
  • Learning rate: [0.05, 0.001, 0.005].
  • Batch size: [64, 128, 256, 512, 1024].
  • Number of Iterations: [64, 128, 256].
  • Dropout rate: [0.2, 0.3, 0.5].
  • Weight decaying rate: [0.01, 0.001, 0.0001].
  • Epochs: [50, 100, 150].
  • Patience: [15, 20, 25].
  • Detection Window Size: [7, 14, 21].

4.2.2. Metrics

Model performance is evaluated from two perspectives: predictive accuracy, using accuracy, precision, recall, and F1-score; and portfolio return, using widely adopted risk-return indicators including Cumulative Rate of Return (CRR), Annualized Rate of Return (ARR), Annualized Volatility Ratio (AVR), Maximum Drawdown (MD), Sharpe Ratio (SPR), Calmar Ratio (CR), and Sortino Ratio (STR).

4.3. Comparative Study

To ensure fair evaluation, the proposed model is benchmarked against several baselines, including CNN, LSTM, CNN-LSTM-ResNet in [14], BiLSTM, GRU, and Temporal Fusion Transformers (TFTs). All models use the same input (time-series feature matrix) and loss function to ensure comparability.
  • CNN-LSTM-ResNet: Our method extends the CNN-LSTM-ResNet framework in [14], retaining the original architecture for direct comparison.
  • LSTM: The LSTM model consists of two layers with 128 hidden units each, followed by a fully connected layer and softmax output for three-class classification [53].
  • GRU: The GRU baseline uses two stacked layers of 128 units, connected to a fully connected layer, and outputs class probabilities [54].
  • BiLSTM: The BiLSTM baseline employs two bidirectional layers with 128 hidden units per direction, followed by a 256-unit fully connected layer and output layer [55].
  • TFT: The TFT baseline employs a 160-unit variable selection network, gated residual networks, 4-head attention, and a 160-unit classification layer.

4.3.1. Accuracy Evaluation

As CNN-LSTM-ResNet was originally designed for binary classification, we compare its performance with our model under this setting in Table 3. Our improvements in loss function optimization, class balancing, attention fusion, and wavelet-based smoothing enable effective three-class classification despite class imbalance. These enhancements improve recall and F1 on hold signals, and precision and F1 on action points. Overall, our model outperforms CNN-LSTM-ResNet by 8.62% in accuracy, demonstrating superior predictive performance for stock trading action prediction.
Table 3. Accuracy comparison between CNN-LSTM-ResNet and HA-CL. Bold indicates the optimal value.
The proposed HA-CL compares its ternary classification with LSTM, BiLSTM, GRU, and TFT in Table 4, where our model beats all baselines. In detail, HA-CL achieves the highest accuracy of 68.89% compared with LSTM of 61.44%, BiLSTM of 62.13%, GRU of 62.50%, and TFT of 68.00%. Table 4 further shows that HA-CL consistently outperforms the baselines in precision, recall, and F1-score across actions (buy/sell). These improvements are mainly attributed to our integration of optimized loss functions, class balancing, and attention mechanisms. The slightly lower recall of the HA-CL model for the hold action is due to the strong predictive power of the TFT model on balanced data. Although LSTM, BiLSTM, GRU, and TFT perform reasonably well, their limitations, such as overfitting in BiLSTM, the absence of attention mechanisms in GRU, and the difficulty of TFT in handling extremely imbalanced classes, explain their lower scores. Furthermore, due to extreme data imbalance and risk considerations, some buy/sell signals are predicted as hold signals, a result of balancing labels and risk-reward considerations. Overall, HA-CL demonstrates the most robust predictive performance among all models in ternary classification.
Table 4. Accuracy comparison between baseline models and HA-CL. Bold indicates the optimal value.

4.3.2. Return Evaluation

We randomly selected 10 stocks from a pool of 63 stocks with representative trends for use in stock trading simulations. In a stock trading simulation, model predictions are recalibrated into actual trading actions. Because the data balancing yields trading intervals rather than isolated signals, we extract actionable buy/sell points within these intervals using a predefined strategy, as presented in Section 3.3. To prevent future data leakage, same-day closing prices are replaced with the average of the last five minutes of trading. Trading points are further refined by detecting changes in slope sign, which identify meaningful extrema.
As shown in Table 5, Table 6 and Table 7, our strategy consistently outperforms the buy & hold baseline. For upward-trending stocks such as sh.600007, sh.600642, and sz.002001, ARR reaches 51.76%, 56.69%, and 52.32%, respectively, exceeding the benchmark models. Figure 4 shows a comparison of the returns of our proposed strategy and the buy-and-hold strategy for upward-trending stocks. Across all tested stocks, AVR and MD values indicate returns are volatile but with controlled downside risk. Sharpe Ratios near 200% further demonstrate strong excess returns per unit risk. Overall, the proposed method achieves superior profitability and risk management compared to conventional strategies. For downward-trending stocks such as sh.600085, sz.000988, and sz.002007, ARR reach 34.07%, 42.11%, and 17.41%, respectively. Figure 5 shows a comparison of the returns of our proposed strategy and the buy & hold strategy for downward-trending stocks. Although identifying profitable opportunities in bear markets is more challenging, our model still surpasses baseline methods in risk-adjusted performance. AVR and MD average about 23% and −20%, reflecting higher volatility, yet Sharpe Ratios remain superior. This demonstrates that, despite slightly higher risk exposure, the model delivers substantially greater rewards. In volatile markets, our model proves especially effective by capturing multiple profitable trading points amid frequent price swings. For instance, sh.601666 achieves an ARR of 111.01%, with an AVR of 30.26% and a moderate MD of −17.62%, resulting in a strong Sharpe Ratio of 256%. Similarly, sh.600521 records an ARR of 66.09% with low volatility (AVR 20.13%) and minimal drawdown (MD −6.42%), yielding an exceptional Calmar Ratio of 1030.10%. Figure 6 shows a comparison of the returns of our proposed strategy and the buy & hold strategy for volatile stocks. Although sz.002241 shows higher returns than other models, it carries slightly greater risk compared to GRU, highlighting the trade-off between return and risk.
Table 5. Return Comparison of baselines in ARR, MD, and AVR.
Table 6. Return comparison of baselines in SPR, CR, and STR.
Table 7. Return of HA-CL in ARR, MD, AVR, SPR, CR, and STR.
Figure 4. Detection trading actions and their return performance in upward-trending stocks: (a) sh.600007; (b) sh.600642.
Figure 5. Detection trading actions and their return performance in downward-trending stocks: (a) sh.600085; (b) sz.000988.
Figure 6. Detection trading actions and their return performance in volatile-trending stocks: (a) sh.601666; (b) sz.002241.
In summary, HA-CL outperforms all baseline models in terms of cumulative and annualized returns. Considering risk via Sharpe Ratios, our model consistently delivers superior risk-adjusted performance, with only marginal exceptions for sh.601666 and sz.000988. Among the baseline models, CNN-LSTM-ResNet yields profits on six stocks, LSTM and GRU on eight, and BiLSTM on nine. Overall, the baseline performance ranking is BiLSTM > GRU > LSTM > CNN-LSTM-ResNet, reflecting both architectural strengths and the effects of class-balancing strategies.

4.4. Ablation Study

To assess the contribution of each component in HA-CL, we performed ablation studies, as shown in Table 8, by removing the loss-function improvement, hierarchical attention, or HA-LSTM enhancements.
Table 8. Ablation Study. Bold indicates the optimal value.
  • Without loss function optimization: Accuracy increased from 68.89% to 86.97%, but F1-scores for buy and sell dropped sharply to 0.08 and 0.07, respectively. This indicates a bias toward the majority “hold” class, yielding illusory high accuracy but failing to identify valuable trading points. Averaged precision, recall, and F1 were only 0.38, 0.36, and 0.36.
  • Without Hierarchical Attention: Accuracy reduced to 65.69%. Averaged precision, recall, and F1 were 0.42, 0.43, and 0.43. Buy-and-sell actions were poorly captured, which confirms that hierarchical attention guides the model to focus on informative features.
  • Without HA-LSTM (Hierarchical Attention retained): Accuracy decreased to 63.56%, with averaged precision, recall, and F1 of 0.43, 0.48, and 0.44. Although better than the hierarchical attention-removed variant, the lack of explicit temporal-spatial attention limits its performance.
These results demonstrate that combining hierarchical attention with LSTM produces the most balanced and effective performance.

5. Discussion

5.1. Significance Test of Channel

This section evaluates the model’s performance across different channel counts (32, 25, 20, 15, 10, 5, and 3) and conducts significance tests to support the findings. As shown in Figure 7, the three-channel model exhibits a smaller standard deviation in comparison to that of other channels, while its mean accuracy is slightly lower than the 20- and 10-channel models, indicating a trade-off between model stability and prediction accuracy.
Figure 7. Prediction accuracies under various channel dimensions.
A paired t-test was performed for each dimensionality-reduction model and the 32-channel model, and the results showed no significant differences. For instance, the 3-channel model versus the 32-channel model without dimensionality reduction yields t(62) = 0.93, p = 0.358, indicating no statistically significant difference at the 99% confidence level. Similarly, other reduced-channel models also show no significant difference compared to the full model. Importantly, the dimensionality reduction drastically decreases the computational load of the model. The 3-channel model has 277,700 parameters and requires only 2.05 s per epoch, while the 32-channel model has 2,683,500 parameters and costs 19.25 s per epoch. That is, our dimensionality reduction reduces about 90% computational load with a comparable accuracy.

5.2. Sensitivity Analysis

This section evaluates the model’s performance across different l values (0.80, 0.85, 0.90, 0.95, 0.99) and performs sensitivity analysis to validate the results. As shown in Figure 8, compared with other λ , the model with λ = 0.9 has a higher F1 for buy and sell signals. λ that is too high can cause the loss function to fail to focus attention, resulting in data bias towards the holding category and thus poor prediction of trading signals. λ that is too low will fail to focus on valuable information signals.
Figure 8. Classification performance under different λ (left chart is sell signal, right chart is buy signal).

5.3. Significance Test of HA-CL

By setting multiple random seeds and conducting 50 independent training sets to obtain sequences related to accuracy, a two-sided significance test with u = 0.6889 was performed to test the stability of the model. The result was t(49) = 0.165, with a p = 0.669. The p-value is significantly greater than 0.05, therefore the null hypothesis is not rejected, which means the model’s stability is supported.

5.4. Analysis of Variability

Multiple initial seed simulation experiments were conducted on all models to obtain the accuracy sequence values for each model, and box plots were generated. As shown in Figure 9, the HA-CL model has the largest mean and the smallest variance, indicating that the model is robust and stable under various initial values.
Figure 9. Analysis of Variability.

6. Conclusions

This paper proposes a robust, interpretable, and computationally efficient HA-CL model to translate complex market dynamics into profitable, risk-adjusted trading actions. We selected a comprehensive set of technical indicators and encoded them into a structured 2D indicator matrix. Features are first extracted via a ResNet-enhanced CNN, then passed through a channel-wise LSTM equipped with a hierarchical attention core to adaptively fuse spatial, temporal, and channel-level importance. Finally, an FC layer with a softmax classifier is applied for the final prediction. To handle the high noise inherent in financial data and produce more balanced action labels, we apply DWT for signal smoothing. To mitigate the severe class imbalance, we design a customized extrema-based labeling method that combines extrema oversampling with an importance-aware focal loss to enhance model training. In addition, we introduce a heuristic action-recalibration strategy to identify more actionable buy and sell points. Experimental results on 63 Chinese A-share stocks demonstrate that HA-CL consistently outperforms all baselines in both classification accuracy and return performance. The model achieves an annualized return of 111.01%, more than five times that of a buy-and-hold strategy, with an accuracy of 68.89% and an average F1 score of 0.54 across all stocks. These results confirm its predictive capability and practical reliability under diverse market conditions. Despite these successes, limitations still remain. Future research may explore multi-stock joint learning, integration with portfolio optimization, and the inclusion of multi-frequency data to further enhance the trading performance.

6.1. Limitations and Optimization Directions

Despite the excellent performance of the HA-CL model in historical backtesting, this study still has some limitations, which point the way for future work.

6.1.1. Limitations of Real-Time Model Application

Deploying the model in live trading still faces challenges. First, data preprocessing and model inference introduce slight delays, which may affect the timeliness of signals in extremely volatile market conditions. Second, the current model uses static parameters, whereas financial markets are non-stationary, which may lead to performance degradation over the long run and necessitate a periodic or triggered retraining mechanism.

6.1.2. Future Optimization

We will develop an adaptive signal filter that combines prediction confidence with real-time market volatility to dynamically adjust trading thresholds and automatically reduce the number of trades in noisy markets, thereby lowering the false positive rate. In addition, we will explore a reinforcement learning framework that directly incorporates trading costs and risk metrics (such as SPR and MD) into the model training objective, allowing the model to automatically weigh potential gains and risks when issuing signals. In summary, future work will focus on advancing the HA-CL model from a precise prediction tool to a more robust and easily deployable automated trading system.

Author Contributions

Conceptualization, H.F. and X.L.; methodology, H.F. and X.L.; software, D.Z. and X.L.; validation, H.F.; formal analysis, H.F. and X.L.; investigation, H.F.; resources, D.Z.; data curation, H.K.; writing—original draft preparation, H.F.; writing—review and editing, X.L.; visualization, H.F.; supervision, D.Z. and H.K.; project administration, X.L.; funding acquisition, X.L. All authors have read and agreed to the published version of the manuscript.

Funding

The authors are grateful for the long-term support of the School of Automation, Qingdao University.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data supporting this study are available upon request from fenghao1@qdu.edu.cn.

Acknowledgments

Thanks are extended to the editors and reviewers.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A

See Table A1 for the indicator definitions.
Table A1. Indicators.

References

  1. Wu, J.L.; Tang, X.R.; Hsu, C.H. A prediction model of stock market trading actions using generative adversarial network and piecewise linear representation approaches. Soft Comput. 2023, 27, 8209–8222. [Google Scholar] [CrossRef] [Scilit]
  2. Ye, X.; Li, H. ARMA-VWAP Strategy and Its Application in Chinese Stock Market. In Proceedings of the 2011 International Conference on Social Sciences and Society (ICSSS 2011), Shanghai, China, 14–15 October 2011; Volume 2, pp. 268–272. [Google Scholar]
  3. Wei, W.; Li, H.; Wang, X.; Li, J. Time series forecasting by ANN and SVM hierarchical architecture. In Proceedings of the 2nd International Conference on Computer Science and Education, Wuhan, China, 25–27 July 2007; pp. 25–28. [Google Scholar]
  4. Ma, C.; Zhang, J.; Liu, J.; Ji, L.; Gao, F. A parallel multi-module deep reinforcement learning algorithm for stock trading. Neurocomputing 2021, 449, 290–302. [Google Scholar] [CrossRef] [Scilit]
  5. Sang, S.; Li, L. A Novel Variant of LSTM Stock Prediction Method Incorporating Attention Mechanism. Mathematics 2024, 12, 945. [Google Scholar] [CrossRef] [Scilit]
  6. Jafari, A.; Haratizadeh, S. GCNET: Graph-based prediction of stock price movement using graph convolutional network. Eng. Appl. Artif. Intell. 2022, 116, 105452. [Google Scholar] [CrossRef] [Scilit]
  7. Peng, H.; Dong, K.; Yang, J. Stock Price Movement Prediction based on Relation Type guided Graph Convolutional Network. Eng. Appl. Artif. Intell. 2023, 126, 106948. [Google Scholar] [CrossRef] [Scilit]
  8. Lee, M.C. Temporal Fusion Transformer-Based Trading Strategy for Multi-Crypto Assets Using On-Chain and Technical Indicators. Systems 2025, 13, 474. [Google Scholar] [CrossRef] [Scilit]
  9. Park, M.; Kim, J.; Enke, D. A novel trading system for the stock market using Deep Q-Network action and instance selection. Expert Syst. Appl. 2024, 257, 125043. [Google Scholar] [CrossRef] [Scilit]
  10. Xu, H.; Chai, L.; Luo, Z.; Li, S. Stock movement prediction via gated recurrent unit network based on reinforcement learning with incorporated attention mechanisms. Neurocomputing 2022, 467, 214–228. [Google Scholar] [CrossRef] [Scilit]
  11. Jarrah, M. Long Short-Term Memory and Discrete Wavelet Transform based Univariate Stock Market Prediction Model. J. Inf. Organ. Sci. 2024, 48, 263–277. [Google Scholar] [CrossRef] [Scilit]
  12. Huang, Y.; Gao, Y.; Gan, Y.; Ye, M. A new financial data forecasting model using genetic algorithm and long short-term memory network. Neurocomputing 2021, 425, 207–218. [Google Scholar] [CrossRef] [Scilit]
  13. Sezer, O.B.; Ozbayoglu, A.M. Algorithmic financial trading with deep convolutional neural networks: Time series to image conversion approach. Appl. Soft Comput. 2018, 70, 525–538. [Google Scholar] [CrossRef] [Scilit]
  14. Khodaee, P.; Esfahanipour, A.; Taheri, H.M. Forecasting turning points in stock price by applying a novel hybrid CNN-LSTM-ResNet model fed by 2D segmented images. Eng. Appl. Artif. Intell. 2022, 116, 105464. [Google Scholar] [CrossRef] [Scilit]
  15. LeCun, Y.; Bengio, Y. Convolutional networks for images, speech, and time series. In The Handbook of Brain Theory and Neural Networks; ACM, Inc.: New York, NY, USA, 1998. [Google Scholar]
  16. Ji, S.; Xu, W.; Yang, M.; Yu, K. 3D Convolutional Neural Networks for Human Action Recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2013, 35, 221–231. [Google Scholar] [CrossRef] [Scilit]
  17. Shelhamer, E.; Long, J.; Darrell, T. Fully Convolutional Networks for Semantic Segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 640–651. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  18. Yang, H.; Zhu, Y.; Huang, Q. A Multi-indicator Feature Selection for CNN-Driven Stock Index Prediction. In Lecture Notes in Computer Science, Proceedings of the 25th International Conference on Neural Information Processing (ICONIP); Springer: Cham, Switzerland, 2018; Volume 11305, pp. 35–46. [Google Scholar] [CrossRef] [Scilit]
  19. Zhang, D.; Cai, E. Improving Stock Price Forecasting Using a Large Volume of News Headline Text. Comput. Mater. Contin. 2021, 69, 3931–3943. [Google Scholar] [CrossRef] [Scilit]
  20. Li, Y.; Wang, X.; Guo, Y. CNN-Trans-SPP: A small Transformer with CNN for stock price prediction. Electron. Res. Arch. 2024, 32, 6717–6732. [Google Scholar] [CrossRef] [Scilit]
  21. Williums, R.; Zipser, R. A learning algorithm for continually training neural networks. Neural Comput. 1989, 1, 270–280. [Google Scholar] [CrossRef] [Scilit]
  22. Jordan, M.I. Attractor dynamics and parallelism in a connectionist sequential machine. In Proceedings of the 8th Annual Conference of the Cognitive Science Society, Amherst, MA, USA, 15–17 August 1986; Lawrence Erlbaum Associates: Mahwah, NJ, USA, 1986; pp. 531–546. [Google Scholar]
  23. Norris, D. Short-Term Memory and Long-Term Memory are Still Different. Psychol. Bull. 2017, 143, 992–1009. [Google Scholar] [CrossRef] [Scilit]
  24. Cho, K.; Van Merriënboer, B.; Gulcehre, C.; Bahdanau, D.; Bougares, F.; Schwenk, H.; Bengio, Y. Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv 2014, arXiv:1406.1078. [Google Scholar] [CrossRef] [Scilit]
  25. Zhu, P.; Li, Y.; Hu, Y.; Xiang, S.; Liu, Q.; Cheng, D.; Liang, Y. MCI-GRU: Stock prediction model based on multi-head cross-attention and improved GRU. Neurocomputing 2025, 638, 130168. [Google Scholar] [CrossRef] [Scilit]
  26. Cui, Z.; Ke, R.; Pu, Z.; Wang, Y. Deep bidirectional and unidirectional LSTM recurrent neural network for network-wide traffic speed prediction. arXiv 2018, arXiv:1801.02143. [Google Scholar]
  27. Hu, X.; Liu, T.; Hao, X.; Lin, C. Attention-based Conv-LSTM and Bi-LSTM networks for large-scale traffic speed prediction. J. Supercomput. 2022, 78, 12686–12709. [Google Scholar] [CrossRef] [Scilit]
  28. Ye, Z.; Lan, W.; Zhou, W.; He, Q.; Hong, L.; Yu, X.; Gao, Y. Elite GA-based feature selection of LSTM for earthquake prediction. J. Supercomput. 2024, 80, 21339–21364. [Google Scholar] [CrossRef] [Scilit]
  29. Chen, K.; Zhou, Y.; Dai, F. A LSTM-based method for stock returns prediction: A case study of China stock market. In Proceedings of the 2015 IEEE International Conference on Big Data, Santa Clara, CA, USA, 29 October–1 November 2015; pp. 2823–2824. [Google Scholar]
  30. Dezsi, E.; Nistor, I.A. Can deep machine learning outsmart the market? A comparison between econometric modelling and long-short term memory. Rom. Econ. Bus. Rev. 2016, 11, 54–73. [Google Scholar]
  31. Tian, L.; Feng, L.; Yang, L.; Guo, Y. Stock price prediction based on LSTM and LightGBM hybrid model. J. Supercomput. 2022, 78, 11768–11793. [Google Scholar] [CrossRef] [Scilit]
  32. Zhu, M.; Qi, H.; Qin, P. IGWO-MALSTM: An Improved Grey Wolf-Optimized Hybrid LSTM with Multi-Head Attention for Financial Time Series Forecasting. Appl. Sci. 2025, 15, 6619. [Google Scholar] [CrossRef] [Scilit]
  33. Livieris, I.E.; Pintelas, E.; Pintelas, P. A CNN-LSTM model for gold price time-series forecasting. Neural Comput. Appl. 2020, 32, 17351–17360. [Google Scholar] [CrossRef] [Scilit]
  34. Selvin, S.; Vinayakumar, R.; Gopalakrishnan, E.A.; Menon, V.K.; Soman, K.P. Stock price prediction using LSTM, RNN and CNN-sliding window model. In Proceedings of the 2017 International Conference on Advances in Computing, Communications and Informatics (ICACCI), Manipal, India, 13–16 September 2017; pp. 1643–1647. [Google Scholar]
  35. Zhang, J.; Ye, L.; Lai, Y. Stock Price Prediction Using CNN-BiLSTM-Attention Model. Mathematics 2023, 11, 1985. [Google Scholar] [CrossRef] [Scilit]
  36. Cao, C.; Luo, Z.; Xie, J.; Li, L. Stock price prediction based on MDT-CNN-LSTM model. J. Comput. Eng. Appl. 2022, 58, 280–286. [Google Scholar]
  37. Song, H.; Choi, H. Forecasting Stock Market Indices Using the Recurrent Neural Network Based Hybrid Models: CNN-LSTM, GRU-CNN, and Ensemble Models. Appl. Sci. 2023, 13, 4644. [Google Scholar] [CrossRef] [Scilit]
  38. Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. CBAM: Convolutional Block Attention Module. In Proceedings of the 15th European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar] [CrossRef] [Scilit]
  39. Feng, C.; Yang, H.; Wang, S.; Li, X. Triaxial modality attention fusion with top-down mask generation for enhanced multimodal sentiment analysis. J. Supercomput. 2025, 81, 975. [Google Scholar] [CrossRef] [Scilit]
  40. Wang, W.; Tan, X.; Zhang, P.; Wang, X. A CBAM Based Multiscale Transformer Fusion Approach for Remote Sensing Image Change Detection. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2022, 15, 6817–6825. [Google Scholar] [CrossRef] [Scilit]
  41. Zhao, H.; Xue, L. Research on stock forecasting based on LSTM-CNN-CBAM model. Comput. Eng. Appl. 2021, 57, 203–207. [Google Scholar]
  42. Ye, P.; Zhang, H.; Zhou, X. CNN-CBAM-LSTM: Enhancing Stock Return Prediction Through Long and Short Information Mining in Stock Prediction. Mathematics 2024, 12, 3738. [Google Scholar] [CrossRef] [Scilit]
  43. Cui, C.; Li, Y. Research on Chinese stock index prediction based on MVC5B hybrid model. J. Comput. Eng. Appl. 2024, 60, 284–296. [Google Scholar]
  44. Lai, C.Y.; Chen, R.C.; Caraka, R.E. Prediction stock price based on different index factors using LSTM. In Proceedings of the 2019 International Conference on Machine Learning and Cybernetics (ICMLC), Kobe, Japan, 7–10 July 2019; pp. 416–421. [Google Scholar] [CrossRef] [Scilit]
  45. Zeng, H.; Marshall, B.R.; Nguyen, N.H.; Visaltanachoti, N. Technical indicators and cross-sectional expected returns. Glob. Financ. J. 2023, 56, 100781. [Google Scholar] [CrossRef] [Scilit]
  46. Gong, Y.; Wu, J.M.T.; Li, Z.; Liu, S.; Sun, L.; Chen, C.M. A CNN-Based Method for AAPL Stock Price Trend Prediction Using Historical Data and Technical Indicators. In Smart Innovation Systems and Technologies, Proceedings of the Advances in Intelligent Systems and Computing (ECC 2021); Zhang, J., Chen, C., Chu, S., Kountchev, R., Eds.; Springer: Singapore, 2022; Volume 268, pp. 25–33. [Google Scholar] [CrossRef] [Scilit]
  47. Shynkevich, Y.; McGinnity, T.M.; Coleman, S.A.; Belatreche, A.; Li, Y. Forecasting price movements using technical indicators: Investigating the impact of varying input window length. Neurocomputing 2017, 264, 71–88. [Google Scholar] [CrossRef] [Scilit]
  48. Hu, X.; Pan, Y.; Li, X. Semi-Varying Coefficient Panel Data Model with Technical Indicators Predicts Stock Returns in Financial Market. J. Syst. Sci. Complex. 2024, 37, 1638–1652. [Google Scholar] [CrossRef] [Scilit]
  49. Kouatli, I.; Yunis, M. A Guide to stock-trading decision Making based on popular Technical Indicators. In Proceedings of the 2021 International Conference on Decision Aid Sciences and Application (DASA), Sakheer, Bahrain, 7–8 December 2021. [Google Scholar] [CrossRef] [Scilit]
  50. Hong, J.; Han, P.; Rasool, A.; Chen, H.; Hong, Z.; Tan, Z.; Lin, F.; Wei, S.X.; Jiang, Q. A Correlational Strategy for the Prediction of High-Dimensional Stock Data by Neural Networks and Technical Indicators. In Big Data and Security; Tian, Y., Ma, T., Jiang, Q., Liu, Q., Khan, M.K., Eds.; Springer: Singapore, 2023; pp. 405–419. [Google Scholar]
  51. Wang, K. Multifactor prediction model for stock market analysis based on deep learning techniques. Sci. Rep. 2025, 15, 5121. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  52. Carosia, A.E.d.O.; da Silva, A.E.A.; Coelho, G.P. Predicting the Brazilian Stock Market with Sentiment Analysis, Technical Indicators and Stock Prices: A Deep Learning Approach. Comput. Econ. 2025, 65, 2351–2378. [Google Scholar] [CrossRef] [Scilit]
  53. Chittora, V.; Gupta, C.P. Dynamic spot price forecasting using stacked LSTM networks. In Proceedings of the 2020 3rd International Conference on Intelligent Sustainable Systems (ICISS), Thoothukudi, India, 3–5 December 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 1080–1085. [Google Scholar]
  54. Salimath, S.; Chatterjee, T.; Mathai, T.; Kamble, P.; Kolhekar, M. Prediction of stock price for indian stock market: A comparative study using LSTM and GRU. In Proceedings of the International Conference on Advances in Computing and Data Sciences, Nashik, India, 23–24 April 2021; Springer: Cham, Switzerland, 2021; pp. 292–302. [Google Scholar]
  55. Gangwani, P.; Panthi, V. Leveraging multimodal data and deep learning for enhanced stock market prediction. In AI-Based Advanced Optimization Techniques for Edge Computing; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2025; pp. 93–127. [Google Scholar]
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.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.