Commit graph Warrior_EA/research/learn_selection.py
Author SHA1 Message Date
AnimateDread
821f16df8b research: model-selected retail fades hold up out of sample (after killing a big leak)
Reframes what the net is asked. Direction is the one thing the data says is
barely predictable; but the fade of retail pin/inside setups has a MEASURED
gross edge of ~0.139 R and a cost of spread/stop that varies 5x across
instruments, sessions and vol regimes. So the answerable question is selection:
spend the edge only where it survives.

  label     realised R of the fade (what actually pays)
  features  28, all knowable at entry, incl. the volume-profile levels
  split     CHRONOLOGICAL train/val/test; threshold picked on val, frozen for test

TEST BLOCK 2022-08 .. 2026-07, 63,901 candidate trades, keep top 10%:

  mean R  +0.1005  vs  -0.0616 for taking everything
  by year +0.140 +0.075 +0.098 +0.105 +0.105   -> 5/5 positive
  with the COST FEATURE REMOVED: +0.0800, still 5/5 positive

That last control matters: the model is not merely learning 'skip wide
spreads'. Something in the setup geometry, session and level structure carries
signal beyond the cost.

HONEST SIGNIFICANCE. The naive t of +8.06 is not believable - with an 8-day
horizon these trades overlap heavily and thousands share one price path. On a
strictly non-overlapping subset (163 independent trades) it is +0.123 R at
t +1.61; without the cost feature, +0.257 at t +3.45. The overlap filter applies
the H1 horizon to M15 trades too, so 163 is a conservative floor and the true
independent count is higher. Suggestive, not settled.

THE LEAK THIS RUN NEARLY SHIPPED. First version scored +0.53 R on the held-out
block, t +54. Bar-derived features were read at the FILL bar i2, but the order
fills intrabar and the outcome race starts at the first M5 bar inside i2 - so
i2's close, tick count and realised volatility are not knowable at entry. The
model was seeing how the bar it entered on turned out. Second lookahead of this
hunt (the first was worth +0.15 R in the sweep test).

RULE: a clean chronological split does NOT protect against lookahead. The split
was honest and the features were not. Any feature indexed at the entry bar must
be re-derived from the bar before it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-01 23:15:00 -04:00