Day 162 — A signal is a forecast with a scale you have to choose
Friday, 15 January 2027 · Week 24 of 52 · Alpha · Study day · 65 min
Your definition from last night is probably a number per stock per day, which is right and incomplete, because the missing part is what the number’s units are and that decides everything downstream.
What you should be able to do tonight
- State the interface a signal must satisfy: what it takes, what it returns, and what its units are.
- Say what changes when a signal is a forecast of return, a forecast of rank, and an arbitrary score.
Tasks 65 min
30 min Write the interface in qlib/signals/base.py: a signal takes an as-of date and a universe and returns one number per security, with the units declared as an attribute. Requiring the units to be declared is the point; a score with undeclared units cannot be combined with another one honestly.
25 min Port the two things you already have to it: the pairs spread z-score and the trend follower’s position, both expressed as signals rather than as positions. Then note what you had to decide to do it, which is the sizing rule you had previously buried in each strategy.
10 min Write the three unit conventions and their consequences into reports/milestone-06-alpha-book.md, since week 29 combines signals and cannot do it without them.
The running strategy
qlib/signals/base.py defines the signal interface for the whole alpha book: as-of date in, one score per security out, units declared. The two existing strategies become signals, which separates the forecast from the sizing for the first time.
Resources
Deliverable
qlib/signals/base.py with a declared-units signal interface, and both existing strategies ported to it.
Checkpoint
Your signal returns 0.8 for a stock. What does that number mean, and what would you need to know to size a position from it?
Prepare for tomorrow
Ten minutes tonight so Day 163, Saturday, 16 January 2027 starts clean. This is what the evening email sends you.
Take one quantity, such as 12-month past return, and compute it two ways: as a raw number per stock, and as a cross-sectional rank within the universe on each date.
Plot the time series of each for one stock.
They will look nothing alike. That is tomorrow’s subject.