Enhancing Cross-Sectional Currency Strategies by Context-Aware Learning to Rank with Self-Attention

—

Enhancing Cross-Sectional Currency Strategies by Context-Aware Learning to Rank with Self-Attention

Daniel Poh
Bryan Lim
Stefan Zohren
Stephen Roberts
Published on 5/20/2021
FX
Machine learning
Deep learning
Carry trade
Momentum
Factor investing
Risk management

This paper enhances cross-sectional currency momentum strategies by introducing a context-aware Learning to Rank (LTR) model that re-ranks initial asset rankings using a Transformer-based architecture. Traditional LTR models learn a global ranking function that performs well on average but fails to adapt to time-varying feature distributions, leading to suboptimal rankings during critical periods like risk-off episodes. The proposed method leverages the local ranking context—specifically the top and bottom ranked assets—to refine the initial rankings, analogous to re-ranking techniques in information retrieval. The model uses a Transformer encoder with self-attention and positional encodings to capture inter-item dependencies and order information. Backtesting on 31 currency pairs from 2000 to 2020 shows that the context-aware approach significantly improves risk-adjusted returns, increasing the Sharpe ratio by about 30% compared to baseline LTR models. The improvements are particularly pronounced during risk-off market states, where the model achieves substantially higher Sharpe ratios and better ranking accuracy (NDCG@3). The results demonstrate that incorporating context-awareness into LTR can mitigate the weaknesses of global rankers and enhance the robustness of cross-sectional currency strategies.

Highlights

  • 1Proposes a context-aware Learning to Rank (LTR) model using Transformer self-attention to re-rank initial currency rankings, improving cross-sectional momentum strategies.
  • 2Addresses the limitation of globally learned rankers that ignore time-varying feature distributions, especially during risk-off periods.
  • 3Achieves approximately 30% improvement in Sharpe ratio and significant enhancements in other performance metrics on a slate of 31 currencies.
  • 4Demonstrates improved Sharpe ratios in both normal and risk-off market states, with notable gains during risk-off episodes.

Methods

  • M
    Transformer-based context-aware re-ranking model with positional encodings, multi-head self-attention, and feed-forward networks.
  • M
    Pairwise Logistic loss and ListNet loss for training the re-ranking model.
  • M
    Backtesting with 31 currency pairs from 2000 to 2020, using daily data and volatility scaling to 15% target volatility.
  • M
    Hyperparameter tuning via HyperOpt with 50 iterations and early stopping.

Results

  • R
    Context-aware LTR models outperform baseline LTR models across all financial metrics, with Sharpe ratios increasing from 0.822 (LambdaMART) to 1.008 (LM+L).
  • R
    The best context-aware model (LM+L) achieves a Sharpe ratio of 1.008, Sortino ratio of 1.479, and Calmar ratio of 0.626.
  • R
    Context-aware models improve NDCG@3 ranking accuracy, especially during risk-off states (e.g., LN+L achieves 0.580 vs. 0.560 for baseline LN).
  • R
    Sharpe ratios during risk-off states are significantly enhanced, e.g., LN+L achieves 2.126 vs. 1.151 for baseline LN.
0/5

Analyze Paper

Generate insights from "Enhancing Cross-Sectional Currency Strategies by Context-Awa...".

Suggested Actions