Level 3 AI in trading · Part 4/8
Labels: Triple Barrier and Meta-Labeling
The question a model is meant to answer is usually settled in two lines of code and then never revisited. It is the most consequential decision in the whole pipeline.
Why the fixed horizon fails
The standard approach asks: “is price higher in ten periods?” It has a flaw that invalidates every later evaluation – it ignores the path.
Two paths with identical labels:
- Path A rises steadily by 3 per cent.
- Path B falls 12 per cent in between and closes 3 per cent higher.
To the model both are wins. In practice B is a loss, because any sensible risk management would have stopped out long before. A model trained on such labels learns to prefer situations that cannot actually be held.
The triple-barrier method
Instead of asking after a fixed horizon, three limits are set and the question is which is touched first:
- an upper limit (profit target),
- a lower limit (loss limit),
- a vertical limit (maximum holding time).
The label follows from whichever is touched first: +1, −1 or 0. It therefore reproduces exactly what would have happened to a real position.
One important addition: the barriers are set relative to volatility, for instance as a multiple of current ATR . Fixed percentage barriers otherwise produce almost only time-limit labels in quiet phases and almost only hits in volatile ones – the model then mainly learns the volatility regime.
Meta-labeling
A second idea that decomposes the problem differently.
A primary model – or a plain rule, such as a crossover from Level 2 – determines direction only. A secondary model then answers a single binary question: is this signal likely correct? Its probability becomes the position size, between zero and full.
The benefit is in the division of labour:
- The direction question is hard and noise-prone. It stays with a rule you understand.
- The question “how reliable is this signal” is far more learnable, because it is asked in a context the secondary model can fill with features – volatility, regime, time of day, trend strength.
- The secondary model may set size to zero. It can prevent damage without ever second-guessing direction.
In practice meta-labeling usually does not improve the hit rate but the ratio of win to loss – it filters out the weak signals. In the language of Level 1 : it raises expectancy per trade, not the number of winners.
The side effect
Both methods create a problem covered in the next article: when a label runs until a barrier is touched, neighbouring examples overlap. Two observations one period apart share almost their entire outcome window – and are therefore anything but independent.
Next
Exactly that overlap, and how sample weights handle it.