1. Introduction
Recognizing these challenges, our research aims to develop a stock prediction method that employs the dynamic fusion of multi-dimensional and multi-level features. By integrating data smoothing strategies, we can mitigate the noise often present in global historical stock data, enhancing the reliability of our predictions. Additionally, incorporating attention mechanisms allows us to effectively capture both global and local environmental impacts on stock prices, thereby providing a richer understanding of the market.
To validate the effectiveness of our MDML model, we utilized stock data from the China Securities Index 300 (CSI 300), covering the period from January 2020 to April 2024, as a representation of local market features. Simultaneously, data from the CSI 300 index for the same period were employed to capture global market dynamics. The key contributions of this study are listed below.
We provide a stock prediction method based on the dynamic fusion of multidimensional and multilevel data that successfully captures the impact of both global and local factors on stock prices. By combining variables from many dimensions and levels, the model provides a thorough knowledge of the factors that influence stock price movements. This novel approach analyzes not only the influence of individual features but also the interactions between features, hence increasing the model’s expressive power.
A dynamic weight allocation method is presented that enables the model to dynamically modify the weights of various characteristics according to their relative importance. This guarantees an accurate representation of each feature’s effect on stock prices. The model can represent the changing importance of information across several time points and market conditions by dynamically allocating weights, which enhances the accuracy and dependability of prediction outcomes.
We introduce a Fourier transform method for global features, applying Fourier transform to global features to capture long-term trends in the global environment. This technique helps in understanding the impact of macroeconomic and other broad factors on stock prices over an extended period, providing the model with support from long-term information.
We conducted extensive experiments on stocks from different industries within the CSI 300 index in the Chinese market. The results indicate that the proposed model performs exceptionally well in stock price prediction, significantly outperforming traditional methods and other deep learning approaches, thereby demonstrating its substantial potential in practical applications.
4. Experiments
4.1. Dataset
4.2. Data Process and Model Training
The dataset is divided temporally into training, testing, and validation sets with a ratio of approximately 8:1:1, followed by min–max normalization of the data.
An Adam optimizer is utilized with a learning rate of 0.001 and a batch size of 64, employing the Mean Squared Error (MSE) as the loss function. To investigate the impact of the observation window on the predictive outcome, experiments were conducted with observation windows set to 5, 10, 15, 20, and 25. The results indicated that the model performed optimally with an observation window of 15; thus, this setting was adopted. During the Fourier transformation of global features, the top K frequencies were selected, and it was discovered through experimentation that the model’s predictive performance was best when the top K was set to 7. To mitigate overfitting, an early stopping strategy was employed, halting the training process if the loss value on the validation set did not decrease for five consecutive epochs.
4.3. Evaluation Parameters
where n is the number of samples, is the actual value, is the predicted value, and is the average value.
4.4. Baseline
Here is a brief introduction to the baselines:
- ARIMA [41]: The ARIMA model is a time series forecasting model composed of the Autoregressive (AR) and Moving Average (MA) components. In this approach, we utilize historical closing prices as variables to predict future closing prices. To identify the optimal hyperparameters, we utilize the Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) for parameter specification.
- MA [42]: The MA model is a time series forecasting model that consists solely of the Moving Average component. The predictions of the MA model are influenced by historical data and are suitable for stationary time series data.
- ES [43]: Exponential Smoothing (ES) effectively captures trends and seasonal variations in data, demonstrating strong adaptability to rapidly respond to market changes and adjust forecasts in a timely manner. This makes it suitable for dynamic financial markets. The relevant code for this part of the experiment can be found at https://github.com/DONGTangYuan/multi-dimension-data (accessed on 1 October 2024) for reference.
- lightGBM [44]: LightGBM is an efficient gradient-boosting tree algorithm that excels in handling nonlinear relationships and high-dimensional data, enabling it to capture complex market patterns.
- SVM [45]: Support Vector Machine is a supervised learning algorithm that finds an optimal hyperplane to separate data into two categories. It applies to both classification and regression problems. The SVM model can capture complex nonlinear relationships in historical data and is therefore widely used in stock price forecasting.
- RF [46]: Random Forest is an ensemble learning algorithm that makes predictions through multiple decision trees. In this stock prediction model, in addition to utilizing fundamental features such as opening price, highest price, lowest price, and trading volume, we have also incorporated technical indicators such as moving averages, Relative Strength Index (RSI), Bollinger Bands, and Moving Average Convergence Divergence (MACD).
- CNN-LSTM [23]: The CNN-LSTM model is a model that combines Convolutional Neural Networks and Recurrent Neural Networks. It extracts features from the input sequence using convolutional networks and then makes predictions using recurrent networks.
- DTML [34]: The DTML model is a transformer-based model. It learns the correlations between stocks in an end-to-end manner. DTML captures asymmetric and dynamic correlations by learning the temporal correlations within each stock and generates multi-level context based on the global market context.
- LSTM-BN [47]: The LSTM-BN model is a model based on Recurrent Neural Networks and Batch Normalization. It accelerates the training process and improves prediction accuracy through batch normalization.
4.5. Experiment Result
4.6. Case Study
To substantiate the efficacy of our predictive model, an in-depth case study was conducted focusing on a select group of the most representative stocks within the CSI 300 index. This study was designed to meticulously assess the model’s forecasting capabilities by comparing its predicted values against the actual market outcomes. The selected stocks were chosen based on their market capitalization, liquidity, and influence on the overall index, ensuring a comprehensive reflection of the model’s performance across various sectors and market conditions. The testing period for this case study spanned from 1 April 2024, to 1 June 2024, a timeframe that encapsulates a variety of market conditions, including seasonal fluctuations and potential macroeconomic events that could influence stock prices.
4.7. Ablation Study
To verify the effectiveness of our model, we conducted ablation studies. The setup of the ablation studies is as follows:
my-model-1: The Discrete Fourier Transform (DFT) is removed, while dynamic weights and feature dynamic fusion are retained, to verify the impact of the DFT on the model.
my-model-2: Dynamic weights are removed, while the DFT and feature dynamic fusion are retained, to verify the impact of dynamic weights on the model.
my-model-3: Feature dynamic fusion is removed, while the DFT and dynamic weights are retained, to verify the impact of feature dynamic fusion on the model.
my-model: The complete model, including the DFT, dynamic weights, and feature dynamic fusion.
In this experiment, we conducted experiments on two datasets from the finance and construction industries within the CSI 300. The results of the experiment are as follows:
6. Conclusions
In conclusion, this paper presents a novel deep neural network model for stock price prediction that effectively integrates multi-dimensional and multi-level features. By dynamically assigning weights to various stock features and applying the Fourier transform to capture long-term trends, the model successfully combines global and local information to reflect the overall market environment’s impact on individual stocks. The incorporation of an attention mechanism and RNN-based structure further enhances the model’s ability to capture temporal dynamics, leveraging historical price data to improve prediction accuracy. Experimental results on stocks from different industries within the CSI 300 index demonstrate the model’s superior performance compared to traditional methods and other deep learning approaches, highlighting its potential for more accurate and robust stock price prediction. However, the research presented in this paper still has several limitations. For instance, the experiments were conducted exclusively within the context of the Chinese stock market and relied solely on numerical data, neglecting textual information, which may limit the model’s predictive performance and expressive capability. Therefore, in future work, it would be beneficial to incorporate a broader range of information into the model, including textual data, and to validate the model’s effectiveness across stock markets in other countries.
Source link
Yuxin Dong www.mdpi.com