Table of Contents
Fetching ...

Stockformer: A Price-Volume Factor Stock Selection Model Based on Wavelet Transform and Multi-Task Self-Attention Networks

Bohan Ma, Yushan Xue, Yuan Lu, Jing Chen

TL;DR

Stockformer is introduced, a price-volume factor stock selection model that integrates wavelet transformation and a multitask self-attention network, aimed at enhancing responsiveness and predictive accuracy regarding market instabilities.

Abstract

As the Chinese stock market continues to evolve and its market structure grows increasingly complex, traditional quantitative trading methods are facing escalating challenges. Particularly, due to policy uncertainty and the frequent market fluctuations triggered by sudden economic events, existing models often struggle to accurately predict market dynamics. To address these challenges, this paper introduces Stockformer, a price-volume factor stock selection model that integrates wavelet transformation and a multitask self-attention network, aimed at enhancing responsiveness and predictive accuracy regarding market instabilities. Through discrete wavelet transform, Stockformer decomposes stock returns into high and low frequencies, meticulously capturing long-term market trends and short-term fluctuations, including abrupt events. Moreover, the model incorporates a Dual-Frequency Spatiotemporal Encoder and graph embedding techniques to effectively capture complex temporal and spatial relationships among stocks. Employing a multitask learning strategy, it simultaneously predicts stock returns and directional trends. Experimental results show that Stockformer outperforms existing advanced methods on multiple real stock market datasets. In strategy backtesting, Stockformer consistently demonstrates exceptional stability and reliability across market conditions-whether rising, falling, or fluctuating-particularly maintaining high performance during downturns or volatile periods, indicating a high adaptability to market fluctuations. To foster innovation and collaboration in the financial analysis sector, the Stockformer model's code has been open-sourced and is available on the GitHub repository: https://github.com/Eric991005/Multitask-Stockformer.

Stockformer: A Price-Volume Factor Stock Selection Model Based on Wavelet Transform and Multi-Task Self-Attention Networks

TL;DR

Stockformer is introduced, a price-volume factor stock selection model that integrates wavelet transformation and a multitask self-attention network, aimed at enhancing responsiveness and predictive accuracy regarding market instabilities.

Abstract

As the Chinese stock market continues to evolve and its market structure grows increasingly complex, traditional quantitative trading methods are facing escalating challenges. Particularly, due to policy uncertainty and the frequent market fluctuations triggered by sudden economic events, existing models often struggle to accurately predict market dynamics. To address these challenges, this paper introduces Stockformer, a price-volume factor stock selection model that integrates wavelet transformation and a multitask self-attention network, aimed at enhancing responsiveness and predictive accuracy regarding market instabilities. Through discrete wavelet transform, Stockformer decomposes stock returns into high and low frequencies, meticulously capturing long-term market trends and short-term fluctuations, including abrupt events. Moreover, the model incorporates a Dual-Frequency Spatiotemporal Encoder and graph embedding techniques to effectively capture complex temporal and spatial relationships among stocks. Employing a multitask learning strategy, it simultaneously predicts stock returns and directional trends. Experimental results show that Stockformer outperforms existing advanced methods on multiple real stock market datasets. In strategy backtesting, Stockformer consistently demonstrates exceptional stability and reliability across market conditions-whether rising, falling, or fluctuating-particularly maintaining high performance during downturns or volatile periods, indicating a high adaptability to market fluctuations. To foster innovation and collaboration in the financial analysis sector, the Stockformer model's code has been open-sourced and is available on the GitHub repository: https://github.com/Eric991005/Multitask-Stockformer.
Paper Structure (60 sections, 15 equations, 10 figures, 12 tables)

This paper contains 60 sections, 15 equations, 10 figures, 12 tables.

Figures (10)

  • Figure 1: Stockformer architecture diagram, which primarily consists of three parts: the Decoupling Flow Layer, the Dual-Frequency Spatiotemporal Encoder, and the Dual-Frequency Fusion Decoder.
  • Figure 2: Temporal graph depicting a year with each time slot representing a day. Each red directed line connects two adjacent time slots, while each black directed line connects the same time slot in two adjacent months.
  • Figure 3: Visualization of the dataset division method used in this study. Each segment represents a specific period in the rolling window analysis, showing the division into training, validation, and test sets across the specified dates.
  • Figure 4: Hyperparameter Sensitivity Analysis. In the figure, the blue line represents the Information Coefficient (IC) values on the test set (out-of-sample predictions), while the red line represents the Information Coefficient Information Ratio (ICIR) values. The metrics evaluate the impact of various hyperparameters including hidden layer size, number of encoder layers, batch size, and classification loss weight on the model's prediction accuracy and stability.
  • Figure 5: In the TopKDropout strategy, with TopK as 5 and Drop as 3: Prior to the subsequent position adjustment, the three lowest-ranked stocks are discarded. From the remaining stocks, excluding the current holdings, the top three with the highest scores (given by TopK-Drop, i.e., 5-3) are chosen for the next trading cycle.
  • ...and 5 more figures