feat(sl-hunting): v5n + SLH-020 - the second seller is the random seller (+ 30 Sep note) - #192
Merged
Merged
Conversation
29 Sep, the first session with v5m in the prompt (the runner started 09:14:46, after #190 merged at 09:08). The note's flat -> SELL branch was right for both books again. IH sold from 09:20 and booked at 09:30: "if a retracement comes here it will not be small, because random sellers can come in, and when the market removes them, sometimes the retracement is just as big." The agent took the same first trade (09:22 -> 09:32, +6,246.75). At 10:00 its own HOLD read was "that first leg already played out... consolidating in a tight ~50pt range"; three minutes later it sold into that box on "declined continuously... no major retracement" and was cut half an hour later with NIFTY flat (-1,504.50). None of the day's 80 recorded decisions cited v5m. Day +4,742.25. v5n is a sub-bullet of MOVE-EXHAUSTION, right after v5m, giving it the mechanism it lacked: the late seller on a follow day is IH's "random seller", and whoever joins the same move a second time is that crowd. It carries IH's counterweight too ("opportunity comes, in an hour or two, but at the right place" -- said of his own late entry), so it does not read as "never re-enter". RE-MEASURED with today's trade (36 after-win re-entries): -10,807.25, 39% win, vs +33,714.25 over 43 after a loss. Both halves now negative (-9,312.50 / -1,494.75), but the latest third is +139.50, dropping two sessions makes it +1,414.75, and p = 0.056 before multiple-comparison correction. STILL NOT A GATE. Offered in the doc instead (not built): state the earlier winning exit in the order-tool response when the agent re-enters the same side -- the SLH-019 pattern, a fact at the tool boundary that refuses nothing. Knowledge-only: no runtime change. Marker test pins seven clauses; nine mutations all caught (the first run found an unpinned phrase and the test was tightened), control passes. Local checks (market still open, so the full suite was left to CI): ruff clean; SL Hunting tests 277 passed; pre-commit passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-entry
Operator-approved addendum to v5n. On 2026-09-29 the agent booked a winning
short, called the leg "played out" at 10:00, and sold the same box at 10:02 --
with v5m in its prompt and cited nowhere. v5m/v5n measure that re-entry as the
weak trade, but not robustly enough to block it, so this REFUSES NOTHING: it
puts the earlier close in front of the model at the two moments that matter,
as a fact it cannot relabel away (the SLH-019 pattern).
* SLHuntingAIWorker records the finished trade at
_arm_post_exit_cooldown_if_flat -- the basket-flat transition every close
path shares (agent EXIT, mechanical stop/target, max-loss, square-off,
lone-mirror sweep): direction (taken at entry), closed_at (IST),
booked_pnl (realized_pnl delta since entry, both legs -- SLH-019's basis)
and nifty_when_flat (shared store ONLY, never a broker call on an exit
path; omitted when absent). Recorded before the cooldown's early return,
so SL_HUNTING_POST_EXIT_COOLDOWN_MINUTES=0 does not switch it off.
last_closed_trade_today() returns it for the current session only.
* MasterWorkerExecutor, duck-typed like the SLH-005 cooldown: position_state
carries last_closed_trade_today while flat; an ACCEPTED entry on the same
side as a close that booked a profit carries same_side_after_winning_exit
and logs an "SLH-020:" INFO line so flagged entries can be counted later.
A worker without the hook, or a failing hook, changes nothing.
* The position_state and order-tool descriptions name both fields and say
they refuse nothing; v5n names them too.
Nothing is refused that was not refused before: SLH-005/SLH-016 rejections are
unchanged, and the flag is added only after the order is accepted.
Tests: six on fakes (flat snapshot; flag on a same-side entry after a win,
which still reaches the worker; no flag for opposite side / losing / break-even
/ non-numeric / nothing closed; broken hook; cooldown refusal unchanged;
descriptions) and three on the REAL worker (a mechanical AI_TARGET close is
recorded with the basket's booked figure -- an earlier 250 of P&L seeded so the
running total cannot pass for it -- and flags the re-entry with the cooldown
off; a losing close records but never flags; another session's record is never
reported). Negative-tested with nine code mutations -- break-even counted as a
win, direction check dropped, flat snapshot omits it, hook failure uncontained,
record moved behind the cooldown's return, booked figure from the running
total, stale session reported, direction not captured, description loses the
field -- all caught; control passes. Plus a knowledge mutation on v5n's new
SLH-020 paragraph, caught.
Gates (run after the 15:15 square-off): master 639 OK; 28 market-data-health;
1701 pytest; ruff; mypy (82 files); compileall; bandit (0); pre-commit.
Coverage is left to CI, per CLAUDE.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Source: 'Prediction For 30 SEP 2026' (NrPmCbzrzSY, uploaded 2026-09-29 21:25 IST). Addendum to #192. BRANCHES FLIPPED FROM 29 SEP. Selling on all three indices was matched by an equal recovery, and the buyers that recovery drew in were already removed by a retracement; NIFTY closed on a retracement at 22,680.90. flat / small gap down BUY -- the recovery's buyers are retraced out and the market is trying to go up again gap up SELL -- no sellers' stops sit above to fuel a rise, and others may buy the gap reading it as positive Levels (nearest first): NIFTY R 22900 / 23000 S 22650 / 22560 (unchanged from 29 Sep) BANKNIFTY R 54650 / 55000 S 54000 / 53790 SENSEX R 73130 / 73450 S 72000 / 71500 Two support pairs were garbled by the ASR and read off the 1080p frame: BankNIFTY "5453 790" = 54,007.90 / 53,787.80, SENSEX "7271500" = 72,000.23 / 71,510.61. No expiry today: NIFTY's weekly and BankNIFTY's monthly both expired 29 Sep. Test retargeted (test_shipped_note_matches_september_30_intraday_hunter_plan); negative-tested with seven mutations (date, un-flipped branches, each branch's reason, a stale BankNIFTY support, a garbled SENSEX support, yesterday's source id), all caught; control passes. 19 premarket tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v5n diligence addendum, doc only. IH's weekend lecture (dVCXZ1PXVYI, 13:32,
uploaded 2026-09-26 13:27 IST) was read in full, 106 segments.
Nearly all of it maps onto rules already written: his buyer chart is
RECRUITMENT HISTORY, NOT CHART SHAPE; "flat, gap-up, even a small gap-down,
same plan" is A SMALL GAP DOES NOT RESCUE A SEATED CROWD; his 25 Sep loss is
already in v5l (and the CSV bears out his "direction was still right": open
23,035.00, 15:15 close 23,128.10).
The one new idea is a split between two seller crowds. Sellers from ONE sudden
fall would flee an adverse gap-up "in one or two candles", so that branch is not
a hunt. Sellers seated through a multi-day fall that already retraced would stay
huntable in every open. Measured on five years of NIFTY spot 1-min, the gap-ups
did the opposite:
after one sudden fall 10 gap-ups, median 65.65 pts still to rise
after 09:16, mean net +6.59, 60% up
after a retraced multi-day fall 21 gap-ups, median 37.00, net -13.96, 38% up
This held in five threshold variants. The samples are small and the definitions
are proxies, so it doesn't prove the reverse -- but a rule the data contradicts
does not go into a live prompt. No knowledge change, no test change.
Also records a transcript-extraction workaround: on this video the button opened
the old panel (get_transcript -> 400), and the modern panel opened directly via
ytd-app.resolveCommand.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Most of this PR comes from the 29 Sep session: IH's live video (
6zppfK_n4yg) compared with this book's two trades.This was also v5m's first live day: the runner started at 09:14:46, after #190 merged, and logged the injected note.
The agent contradicted itself three minutes apart:
None of the day's 80 recorded decisions cited v5m.
v5n: THE SECOND SELLER IS THE RANDOM SELLER
Re-measured (tested, not enforced)
SLH-020 (addendum): tell the agent about today's last close when it re-enters the same side
The prompt rule didn't hold on its first day, and the numbers don't support an enforced gate, so this is the middle option. It refuses nothing.
booked_pnl: the change inrealized_pnlsince entry, both legs (the same basis as SLH-019);nifty_when_flat: read from the shared store only, so there's never a broker call on the exit path.It's recorded even when the post-exit cooldown is turned off, and
last_closed_trade_today()only returns today's record.position_statecarrieslast_closed_trade_today. An accepted entry on the same side as a winning close from earlier today carriessame_side_after_winning_exit, and it logs anSLH-020:line so flagged entries can be counted later. The existing SLH-005 cooldown and SLH-016 already-breached-stop refusals are unchanged.Addendum: pre-open note for 30 SEP 2026
Source:
NrPmCbzrzSY, uploaded 29 Sep 21:25 IST. The branches flipped from 29 Sep:Two support pairs were garbled by the transcript, so I read them off the 1080p chart:
There's no expiry today.
Addendum: the 26 Sep weekly — one candidate, not encoded (doc only)
Source:
dVCXZ1PXVYI, 13:32, read in full. Nearly all of it is already in the knowledge:The one new idea is a split between two kinds of seated sellers:
Measured on five years of NIFTY spot 1-minute data, the gap-ups did the opposite:
The result held in five threshold variants. The samples are small and the definitions are rough stand-ins, so it doesn't prove the reverse either. But I wasn't willing to put a rule the data contradicts into a live prompt. The doc records the lecture, the idea and the measurement, plus a transcript workaround this video needed.
Test plan
test_v5n_the_second_seller_is_the_random_sellerpins seven clauses, plus the SLH-020 wiring. Nine deliberate mutations of the rule were all caught, and a control rewording passes. The first mutation run found one phrase the test wasn't checking, so I tightened the test and re-ran the full set.🤖 Generated with Claude Code