Trend-Scanning Labels
A labeling method for supervised trading models that fits a small trend regression over a sliding window of forward-looking horizons and picks the strongest, most statistically significant trend as the label — instead of relying on a single fixed forecast horizon.
Prerequisites: Triple-Barrier Labeling
Common labeling schemes for supervised trading models — like "did the price rise over the next 10 days?" — force a single, arbitrary forecast horizon onto every observation, even though real trends run for wildly different lengths of time: some moves exhaust themselves in three days, others run for sixty. Forcing a fixed horizon means some labels catch a trend partway through, others catch pure noise after a trend has already ended, and the labeling error itself becomes a source of noise the model has to learn around.
Trend-scanning labels fix this by, for each point in time, fitting a simple linear regression of price against time over a range of candidate forward-looking windows (say, 5 to 60 days ahead) and selecting whichever window produces the strongest trend, measured by the regression's t-statistic on the slope coefficient. The label then records both the direction of that strongest trend (its sign) and its strength (the t-statistic itself), rather than a simple up/down flag from one fixed horizon.
This produces labels that adapt to how long a trend actually persists at each point in history, giving a downstream model a target that reflects genuine trend strength rather than an artifact of picking one horizon that happens to fit some periods and not others — at the cost of extra computation, since a small regression must be re-fit across many candidate windows for every single observation in the dataset.
Trend-scanning labels replace a single fixed forecast horizon with the strongest trend found across a range of candidate windows, using the regression t-statistic to pick both the horizon and the label's confidence — producing targets that adapt to how long real trends actually last instead of forcing every observation onto the same timescale.
Related concepts
Further reading
- López de Prado, Advances in Financial Machine Learning, ch. 5 (successor edition material)