Labelling Financial Data

"How would you label the data for this model?" sounds like a detail, and "the sign of the next day's return" sounds like enough. It is not. The label defines what the model learns, so it should match the trade you would actually make: how long you hold, where you take profit and where you cut the loss. A complete answer also says what the labels do to the effective sample size.

Fixed-horizon labels

The simplest label is the return over a fixed horizon of hh bars:

rt,h=Pt+hPt−1r_{t,h} = \frac{P_{t+h}}{P_t} - 1

Use it as a regression target, or turn it into a class: +1+1 above a threshold τ\tau, −1-1 below −τ-\tau, and 00 in between.

The fixed threshold is the problem. Volatility can change by a factor of several between calm and stressed markets, and the same τ\tau means different things in each. Label 5-day returns with τ=1%\tau = 1\%, and assume normal returns with mean zero. With daily volatility of 0.5%, the 5-day volatility is about 1.12%, and about 37% of the labels are ±1\pm 1. With daily volatility of 2%, the 5-day volatility is about 4.47%, and about 82% of the labels are ±1\pm 1.

The rest of this lesson is for subscribers

Unlock every lesson in Machine Learning for Quantitative Research, and every other premium course.

Subscribe to continue

Test your knowledge

Questions are only available to subscribers.

Keep reading Machine Learning for Quantitative Research

27 lessons in this course, and every other premium course, on one subscription.

  • Every lesson in every course, with the worked examples and interactive simulators
  • Graded questions on every lesson, with explanations for the wrong answers as well as the right one
  • The trainers, timed assessments and brainteaser library that go with them