When people build a model to predict short-term moves, the default label is often a fixed-horizon return: was price higher or lower 15 minutes later? That's easy to compute, but it doesn't match how anyone actually trades. A real scalp has a target, a stop and usually a time limit, and the outcome is whichever of those gets hit first.
The triple-barrier method labels data exactly that way. For each candidate entry you set three barriers:
- an upper barrier, the profit target,
- a lower barrier, the stop,
- a vertical barrier, the maximum holding time.
The label is which barrier was touched first: +1 for the target, -1 for the stop, and either 0 or the sign of the return at that moment for the time barrier.
A couple of details make it work better. The horizontal barriers are usually scaled by recent volatility rather than fixed in pips, so a 1x ATR target means roughly the same thing in a quiet Asian hour and in a busy London open. And the barriers don't have to be symmetric; if your real exits are a 1.5R target and a 1R stop, label with those.
The advantage is that the model learns the thing you care about, which is how trades with your exits would resolve, rather than a return at an arbitrary moment that might have passed through your stop on the way. The cost is that labels depend on the path, so you need tick or at least M1 data inside each window, and the question of which barrier was hit first inside a single bar has to be handled carefully.
Anyone tried both labelling schemes on the same features? I'd expect the triple-barrier version to look worse in-sample but hold up better in a forward test.
Triple-barrier labelling: describing a trade by which comes first, the target, the stop or the clock
-
Shadow Trader
- Posts: 6144
- Joined: Wed Sep 09, 2026 5:19 pm