← Notes

What counts as a win?

A model learns exactly the label you give it. A popular way of labelling trades marked a third of our "successes" as wins even though they ended below half their entry price.

A supervised model has no idea what you want. It learns the label. Every choice about how that label is defined (when you look, what counts as success, what happens if nothing happens) is a choice about what the model will be good at. It is also the part of a trading model that gets the least scrutiny, because once it is written down it feels like ground truth.

The triple-barrier label

A widely used scheme is the triple-barrier method, popularised by Marcos López de Prado. From the moment of a trade you draw three barriers: a profit-taking level above, a stop-loss level below and a time limit. Whichever is touched first decides the label: up first is a win, down first is a loss, and the clock running out is labelled by where the price ended.

It is a real improvement on the naive alternative of labelling by the return over a fixed window. It respects the path, not just the end point, and it mirrors how trades are actually managed, with a target and a stop. We used a version of it ourselves.

What a touch doesn’t tell you

The weakness is in the word first. The label records a moment, and it is silent about everything afterwards. If a price touches the upper barrier and then collapses, the label still says “win”.

In slow markets that rarely matters. In fast ones it can dominate. When we checked what happened after the touch, about a third of the trades labelled as wins had fallen below half of their entry price within a few minutes. Nearly two thirds had ended below the stop level. The label was faithfully reporting that the price had gone up at some point. It was not reporting whether a trade there would have made money.

That has two consequences. The model is rewarded for finding things that go up briefly, which is not the same skill as finding things that go up. And measuring the model on the same label hides the problem completely: it looks accurate, because it is accurate at the wrong question.

A label must match what you do next

The fix is not a different formula. It is to make the label describe the trade you would actually have.

  • If your exit takes profit at the barrier, the touch label is right. The touch is the outcome, because you are out.
  • If you hold beyond it, the label must follow you. Partial exits, trailing stops and timeouts all change what a “win” means, and the label should be computed from the same rules the live system uses, end to end.
  • Use realised outcomes where you have them. For trades that really happened, label from what the wallet received, after costs. For simulated ones, label from a corrected price (see A simulation is only allowed to be pessimistic).

A cheap check worth running

For any label, take each class and look at the distribution of what happened next: the final result, the worst point and the best point over a realistic holding period. A healthy label gives classes that look clearly different on the measure you care about. If a large share of your “wins” end as losses, the label is measuring something else, and the model will learn that something else very well.

It takes an afternoon. It is also one of the few checks that can tell you a model is answering the wrong question even when every accuracy metric says it is doing fine.