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
2024-06-17
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: <a class="link-external link-https" href="https://github.com/Eric991005/Multitask-Stockformer" rel="external noopener nofollow">this https URL</a>.
Trading and Market Microstructure,Machine Learning
What problem does this paper attempt to address?
The paper aims to address several key challenges in predicting the Chinese stock market, particularly the issues of accuracy and responsiveness faced by traditional quantitative trading methods in the context of increasingly complex market structures, policy uncertainties, and frequent market fluctuations triggered by sudden economic events. To tackle these problems, the researchers propose a stock selection model named "Stockformer." Stockformer is a price-volume factor stock selection model based on Wavelet Transform and Multi-Task Self-Attention Networks. Its main goal is to improve responsiveness to market instability and prediction accuracy, achieved through the following aspects: 1. **Multi-Factor Model Input**: A set of 360 price-volume factors is constructed as the main feature input for the Stockformer model, covering multiple dimensions of information such as price, volume, and volatility. 2. **High-Low Frequency Decomposition**: Discrete wavelet transform is used to decompose stock returns into high and low-frequency components to capture long-term trends and short-term fluctuations, including the impact of sudden market events. 3. **Spatio-Temporal Encoder and Attention Mechanism**: A dual-channel spatio-temporal encoder integrated with a fusion attention mechanism is employed to accurately predict individual stock returns and trend changes, while handling temporal dependencies and spatial correlations between stocks, thereby improving prediction accuracy and efficiency. 4. **Graph Embedding Technology**: By constructing spatial and temporal relationship graphs of stocks and applying graph embedding methods, the model deeply analyzes the spatio-temporal characteristics of stocks, helping to capture dynamic market relationships. 5. **Multi-Task Learning Strategy**: A multi-task learning approach is adopted to predict not only stock returns but also the upward or downward trend of stocks. This multi-output framework enables the model to provide a more comprehensive market change prediction, enhancing the robustness of the predictions. Experimental results show that Stockformer outperforms existing advanced methods on multiple real stock market datasets, demonstrating excellent stability and reliability in strategy backtesting under different market conditions. It maintains high performance even during market downturns or volatility periods, showing a high degree of adaptability to market fluctuations.