Labelling: Triple Barriers in Volatility Units

  • October 8, 2026
  • 9 min read

Article 3 of 7 — Building Momentum Systems Without Fooling Yourself. Previous: The Hypothesis Register and the Stage-Gate Funnel · Next: Momentum Probes: The Baseline

Before any signal can be judged, someone has to decide what “right” means. This sounds trivial and is the source of more quiet damage than any other decision in the workflow. The label is the target every downstream evaluation is measured against. If it is a poor proxy for what a trade actually experiences, everything built on it is optimizing the wrong thing, and no statistical rigour afterwards will recover that. This article is about the label I use, why it is expressed the way it is, and why it was fixed before the first backtest and not touched since.

The problem with fixed-horizon returns

The default label in most of the literature is the fixed-horizon return: enter at time t, measure the price change at t + h, call it positive or negative. It is easy to compute, easy to explain, and wrong for a momentum signal in at least three ways.

First, it ignores the path. Two trades that end at the same price after the same number of bars get the same label, even if one drifted gently in your favour and the other collapsed halfway through before recovering. A momentum strategy is a bet that a move continues; the shape of the excursion is the whole point.

Second, real trading has stops. Nobody holds a losing position through an arbitrary drawdown because the calendar has not run out. The fixed-horizon return describes an investor who cannot be stopped out, and no such investor exists on a futures book.

Third — the one that stings — a fixed-horizon return has no notion of “the trade was right but got stopped.” Under any realistic exit structure, a signal can call the direction correctly and still lose money because the adverse excursion before the move was larger than the stop tolerated. The fixed-horizon label calls that trade a success. The account calls it a loss. A label that disagrees with the account is not measuring the thing you care about.

Three barriers, one label

The triple-barrier method, from López de Prado’s Advances in Financial Machine Learning, fixes all three at once. For each entry you draw three lines: an upper barrier above the entry price, a lower barrier below it, and a vertical barrier at some maximum holding time. The label is determined by which barrier the price path touches first. Touch the upper barrier on a long and the trade is a win; touch the lower one and it is a loss; reach the vertical barrier without touching either and the trade is judged on where it stands at expiry, or simply as a non-event, depending on what you want the label to encode. For a short, the roles flip.

The structure is deliberately simple: a profit target, a stop, and a time limit, which is what an actual position in a trend strategy has. The label is path-dependent because the barriers are hit by the path, not by the endpoint. And the “right but stopped” case is now explicit: a trade that would have gone your way after a large excursion is labelled a loss, because that is what would have happened to it. Uncomfortable, and true.

Why the barriers must be adimensional

Here is where most implementations go wrong. If you draw the barriers in price units — so many points above, so many below — the specification only makes sense for one instrument. A stop that is reasonable for a bond future is meaningless for a natural gas contract. You end up with twenty-five barrier settings for twenty-five markets, each “calibrated” to the instrument’s typical range.

Calibrated by whom, and on what data? Every per-instrument setting is a decision made by looking at the history of that instrument, which is the same history you will then backtest on. It is a hidden degree of freedom of exactly the kind the “Illusion” posts described: a knob turned quietly after a glance at the data, never appearing in the trial count. Twenty-five knobs, each nudged until the labels “look right,” is a research process nobody can correct for because nobody wrote it down.

The alternative is to express the barriers in units that already know about the instrument. I use an exponentially-weighted estimate of recent volatility — the kind of estimator that adapts as conditions change and forgets old regimes at a controlled rate — and I scale it by the square root of the horizon, because that is how the dispersion of a random walk grows with time. A barrier expressed as “some multiple of horizon-scaled volatility” says the same thing on every market: the price has moved further than one would expect from noise alone over this holding period. On a quiet instrument the barriers sit close to the entry in price terms; on a violent one they sit far away; in volatility units they are identical.

The result is one specification, applied uniformly across all twenty-five futures, with no per-instrument tuning. The markets are not the same; the label asks the same question of each, and any difference in the answer is a property of the market, not of the calibration.

Asymmetry, and the reasoning for it

The stop and profit barriers are not the same distance from the entry. This is a design choice with a rationale, not a fitted parameter, and the rationale is what a trend-following trade is.

A momentum entry is a bet that a move already under way continues. If the bet is wrong, it tends to be wrong quickly: the move stalls or reverses, and there is little value in giving it room. If it is right, the whole point is to stay with it, and a profit barrier tight enough to be hit by noise would cut off the thing you were trying to capture. One barrier limits the cost of being wrong, the other defines what being right looks like, and there is no reason to expect the same distance to serve both.

I will not give the ratio, and not out of secrecy; it is uninteresting. What matters is that it was chosen from a description of the trade’s logic, written down, and not revisited once the results came in.

What “a priori” means when nobody is watching

The specification — volatility estimator, horizon scaling, the asymmetry, the treatment of the vertical barrier — was written into the register described in Article 2 with a timestamp, before the first labelled dataset was produced. The practical difficulty is not the writing down; it is what happens afterwards.

After the first run there will be a result, and it will be disappointing in some specific way. Too many trades expire at the vertical barrier with uninformative labels. The stop is hit more often than intuition says it should be. Some market shows a win rate that makes no sense. And the thought arrives, dressed as good practice: the specification was a first guess, surely it is reasonable to adjust it now that I have seen how it behaves.

It is not. It is the same move as adding a filter and keeping it because the metric went up, applied one layer down where it is harder to see. The label is the ground truth against which every hypothesis is scored; if the ground truth moves in response to the scores, the scores mean nothing. So the rule is blunt: a change to the labelling specification is a new hypothesis, registered as such, and everything scored under the old specification is re-scored or discarded. The register does not stop me from changing the label. It makes changing it expensive enough that I have to want to.

A property of the path, not of a strategy

One consequence of the construction deserves its own paragraph, because it is what makes the rest of the series possible. The label depends on the entry time, the side, and the price path afterward. It does not depend on which signal generated the entry, which filter was active, or how the position was sized. It is a statement about the market: from this point, in this direction, the path reached the profit barrier before the stop, or it did not.

That independence is what allows the same labels to be reused. The baseline probes of Article 4 are scored against them. The regime features of Article 5 are judged on how well they separate winning labels from losing ones. And in Article 6 the secondary model of the meta-labelling structure is trained on exactly these labels, with the primary model’s side and the regime features as inputs, to estimate the probability that a proposed trade is right. None of that would work if the label had a strategy baked into it. Because it does not, it is a fixed target every layer of the framework can share.

Making Python agree with the platform

A final, unglamorous piece. The labels are computed in Python from raw prices; the trades are executed by the platform, in C#, under its own rules about when a barrier is checked and how a fill is priced. If the two disagree, the judge is scoring trades that never happened. Article 1 described the parity test against the platform’s trade list and the two execution semantics it forced into the open: barriers are evaluated from the bar after the fill, and a gap through a stop or target fills at the open, not at the level. Once both were encoded in the labelling code, agreement became very high, and the label became a faithful description of what the platform would actually have done.

With a fixed, adimensional, path-based label in hand, the next question is what the simplest possible entries look like when scored against it. Article 4 runs six textbook momentum probes over the full universe — no filters, no optimization — and treats the result as a map rather than a strategy.

Reference. López de Prado, M. (2018). Advances in Financial Machine Learning. Wiley.

quanthedgeai — the research arm of algosworksai. Systematic research on mid-frequency instruments.

Get the monthly Market Regime Note

Regimes, volatility and correlations across major futures markets — with the code behind the charts. Free.

Subscribe →