Commit ac4e769
Add 6 features: horizon returns + overnight/intraday + dist-from-high (#36)
Predictor ROADMAP P2 diagnostic — test whether 5d forward is reversal
regime vs momentum regime, and whether splitting close-to-close returns
into overnight/intraday components improves signal.
New features (all technical group):
return_60d, return_120d
Longer-horizon momentum. Neutral name — meta ridge coefficient sign
determines regime. At 5d forward, short-horizon returns load negative
(reversal). If 60d/120d load positive, momentum persists at longer
lookback — a well-documented pattern (Jegadeesh/Titman 1993).
overnight_return_5d, intraday_return_5d
5d sum of (Open_t / Close_{t-1} - 1) vs (Close_t / Open_t - 1).
Lou/Polk/Skouras 2019 "A Tug of War" found overnight persists
positive (earnings, news, macro) while intraday is noisier and often
negative (microstructure, flow). Total momentum_5d ≈ overnight_5d +
intraday_5d. Decomposing lets the model learn different dynamics.
NaN when Open column is missing (no silent zero-fill per
feedback_no_silent_fails).
dist_from_5d_high, dist_from_20d_high
Reversal-native signals. Distance from recent peak as fraction:
(Close - rolling_max(High, N)) / rolling_max(High, N). Always ≤ 0.
A stock at its 5d high has no short-term reversal room; a stock
pulled back has more. Conceptually cleaner than past returns for
reversal signal.
Registry: 6 FeatureEntry rows added under "v3.1 technical additions".
FEATURES list in feature_engineer.py goes from 53 → 59. dropna still
correct — rows missing any required feature are dropped.
## Test plan
- [x] Synthetic OHLCV smoke: all 6 features compute, values in
sensible ranges (dist_from_5d_high ≤ 0 always, overnight/intraday
small magnitudes, return_60d/120d larger).
- [x] Full suite: 43 passed.
- [ ] After merge: re-run alpha-engine-data backfill to populate
historical rows in ArcticDB with the new columns.
- [ ] Predictor PR B2 (follow-up) adds features to MOMENTUM_FEATURES
list + 21d forward IC diagnostic.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0fbd6d5 commit ac4e769
2 files changed
Lines changed: 68 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
123 | 134 | | |
124 | 135 | | |
125 | 136 | | |
| |||
272 | 283 | | |
273 | 284 | | |
274 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
275 | 335 | | |
276 | 336 | | |
277 | 337 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
| |||
0 commit comments