Trade When Opportunity Comes: Price Movement Forecasting via Locality-Aware Attention and Iterative Refinement Labeling

Liang Zeng, Lei Wang, Hui Niu, Ruchen Zhang, Ling Wang, Jian Li

Introduction

Financial market prediction is a high-stakes challenge characterized by an exceptionally low signal-to-noise ratio. Most price movements resemble random walks, leading standard machine learning models to overfit by attempting to find patterns in pure noise. This paper introduces LARA (Locality-Aware Attention and Iterative Refinement Labeling), a framework designed to identify specific "opportunity" windows where trends are predictable and profitable, rather than attempting to forecast every market tick.

The core philosophy is "Trade when opportunity comes." This approach addresses two primary technical hurdles:

  1. Selection Bias: Identifying predictable samples without look-ahead bias.
  2. Label Noise: Managing the stochastic nature of financial labels where identical setups can yield divergent outcomes due to external shocks.

Methodology: The LARA Framework

LARA consists of two primary modules designed to filter noise and refine the learning signal.

The LARA framework architecture, illustrating the Metric Learning, Localization, and Iterative Refined Labeling (RA-Labeling) modules.

Locality-Aware Attention (LA-Attention)

The LA-Attention module serves as a filter to extract potentially profitable samples. It employs a Localization mechanism using masked attention to analyze a sample's neighborhood in the feature space. If a sample is surrounded by historical instances that yielded positive returns, it is flagged as a high-probability opportunity. To optimize this search, Metric Learning is used to define a custom Mahalanobis distance, ensuring that "similarity" is based on features relevant to price movement rather than arbitrary mathematical distance.

Iterative Refinement Labeling (RA-Labeling)

Recognizing that financial labels are often noisy, the RA-Labeling module avoids treating initial labels as absolute truth. It performs Label Refurbishment by iteratively updating labels based on a convex combination of the original label and the model's own predictions. Furthermore, Confidence Weighting utilizes training loss to down-weight samples with high loss, preventing the model from being misled by outliers or "freak accidents" in the data that do not represent repeatable trends.

Experimental Results

The framework was evaluated across three distinct financial domains: China’s A-share stocks (CSI300), high-frequency BTC/USDT cryptocurrency data, and major Chinese ETFs. LARA consistently outperformed state-of-the-art baselines in both precision and profitability.

Performance comparison showing LARA's superior precision across different trade volumes and its significantly higher cumulative return compared to OLS, LightGBM, and other baselines.
  • Precision: LARA achieved 59.1% precision in stock markets and 57.8% in crypto, leading the best baselines (such as SEAL) by 1.5% to 2.5%.
  • Profitability: Back-testing on the 512480.SH ETF demonstrated that LARA's cumulative return significantly exceeds standard models like OLS or LightGBM.
  • Ablation Studies: Removing either LA-Attention or RA-Labeling resulted in a marked performance decline, confirming that both opportunity identification and data cleaning are critical to the model's success.

Conclusion

LARA demonstrates that selective prediction—focusing on high-confidence "neighborhoods" in feature space—is more effective than constant prediction in noisy financial environments. While the model is computationally more intensive due to its iterative nature and neighborhood searches, its ability to ignore market chaos and focus on repeatable trends offers a significant advantage for real-world trading strategies.

Summary updated

Abstract

Price movement forecasting aims at predicting the future trends of financial assets based on the current market conditions and other relevant information. Recently, machine learning(ML) methods have become increasingly popular and achieved promising results for price movement forecasting in both academia and industry. Most existing ML solutions formulate the forecasting problem as a classification(to predict the direction) or a regression(to predict the return) problem over the entire set of training data. However, due to the extremely low signal-to-noise ratio and stochastic nature of financial data, good trading opportunities are extremely scarce. As a result, without careful selection of potentially profitable samples, such ML methods are prone to capture the patterns of noises instead of real signals. To address this issue, we propose a novel price movement forecasting framework, called Locality-Aware Attention and Iterative Refinement Labeling(LARA), which consists of two main components: 1)Locality-aware attention automatically extracts the potentially profitable samples by attending to surrounding class-aware label information. Moreover, equipped with metric learning techniques, locality-aware attention enjoys task-specific distance metrics and distributes attention on potentially profitable samples in a more effective way. 2)Iterative refinement labeling further iteratively refines the labels of noisy samples and then combines the learned predictors to be robust to the unseen and noisy samples. In a number of experiments on three real-world financial markets: ETFs, stocks, and cryptocurrencies, LARA achieves superior performance compared with the traditional time-series analysis methods and a set of machine learning based competitors on the Qlib platform. Extensive ablation studies and experiments also demonstrate that LARA indeed captures more reliable trading opportunities.
BibTeX
@inproceedings{zeng2024trade,
  author = {Liang Zeng and Lei Wang and Hui Niu and Ruchen Zhang and Ling Wang and Jian Li},
  title = {{Trade When Opportunity Comes: Price Movement Forecasting via Locality-Aware Attention and Iterative Refinement Labeling}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2024},
}
Figure