Using Time2Vec and Transformer Attention to Rank Chinese Stocks
Summary
This article introduces Transformer attention and adapts the architecture to stock-factor time series. Its proposed model adds Time2Vec representations to factor inputs so the network can represent both periodic and non-periodic time patterns. Self-attention weights relationships across observations, while stacked encoder layers combine attention with feed-forward layers, residual connections, and normalization. The article also outlines data cleaning, outlier filtering, feature scaling, rolling windows, and a regression target based on forward stock returns.
The illustrative A-share portfolio ranks stocks by predicted returns, buys a daily shortlist, and holds positions for at least several days, allocating more capital to higher-ranked names subject to a per-stock cap. It describes a historical training and evaluation split and gives example model settings, but reports no numerical performance results in the supplied text. The method’s usefulness therefore cannot be assessed from evidence here. Results may depend on factor choice, preprocessing, portfolio rules, and whether the historical evaluation avoids leakage and realistic trading costs.
Key ideas
- Time2Vec is used to add periodic and non-periodic time features to stock-factor sequences.
- Self-attention assigns weights across observations, and encoder layers combine attention with feed-forward processing and residual connections.
- The workflow includes outlier handling, missing-data treatment, feature scaling, rolling input windows, and forward-return prediction.
- The portfolio ranks stocks by predicted return and limits capital allocated to each holding.
- The described historical evaluation provides no numerical results in the supplied text, so predictive performance remains unestablished.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.