kieranjwood/trading-momentum-transformer

This code accompanies the the paper Trading with the Momentum Transformer: An Intelligent and Interpretable Architecture (https://arxiv.org/pdf/2112.08534.pdf).

51
/ 100
Established

Implements a Temporal Fusion Transformer (TFT) attention-LSTM hybrid architecture for futures trading, combining multi-headed attention for regime-aware learning with changepoint detection modules that enable the model to switch between momentum and mean-reversion strategies. Optimizes directly on risk-adjusted metrics (Sharpe ratio) and provides interpretability through attention weight visualization, revealing how the model focuses on momentum turning points and segments trading decisions by market regime. Trains on 600+ continuous futures contracts from Quandl, with optional online changepoint detection at multiple timescales to improve robustness during regime transitions.

603 stars. No commits in the last 6 months.

Stale 6m No Package No Dependents
Maintenance 0 / 25
Adoption 10 / 25
Maturity 16 / 25
Community 25 / 25

How are scores calculated?

Stars

603

Forks

247

Language

Python

License

MIT

Last pushed

Dec 10, 2023

Commits (30d)

0

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/ml-frameworks/kieranjwood/trading-momentum-transformer"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.