Entry situations -- one rule per situation

The user's design (2026-10-20): at the moment of a buy signal, first recognize WHICH SITUATION the stock is in, then apply the rule written for that situation -- not one set of filters for every stock. Every situation below was met in a real trade or a test. "Detect" = measurable at the buy moment (finished bars only). Rule status: HAVE a rule / PARTIAL / NONE. Proposed rules are tested on 2 years before they go live (OFF by default). Updated 2026-10-20.

A. How the signal was produced (is the signal real?)

[2026-10-22] V2 situations: a situation whose rule is already a v2 check is marked V2. The bots log [S7 V2] SYMBOL: v2 held the buy -- ... whenever v2 held a buy ONLY because of such situations (S6, S7, S8, S14, S15, S21; S12 not logged). Code: entry_situations.V2_COVERED / v2_cover().

#SituationExampleDetectRule todayProposed situation rule
S1Window flip: buy share / straightness jump because a big bar left the 15-min window, not because of new buying HPK 10/20: 31%→61% buy share, 0.21→0.66 straightness in 1 min, on 1,680 shares; -$47 buy share up ≥ 20 pts or straightness up ≥ 0.3 in the last 2 min, and the bar that left the window had ≥ 3× the window's average volume RECORD ONLY (10/21): S1 flush-leave flip -- hold until buyers incl. the flush ≥ 55% (2y: 20 held, 70% losers; isolated)T7b: then also require price sloping up (5-bar trend rising, +0.3%) AND volume increasing (last 5 min > 5 before, ≥ normal)
S2Fast price rise / spike in 1-2 minutesNVAX 10/9, PMI 10/13 (+8% in 30 min) one of the last 2 bars moved > 2× the normal 1-min range, or 5-bar acceleration ≥ 1.5 ATR RECORD ONLY (10/21): S2 weak spike -- hold until bars hold the spike middle with buyers ≥ 55% (2y: 88 held -0.238%)T5: don't block -- wait 1-2 min; buy only if the price holds (no close under the spike bar's midpoint) and v2 still passes
S3Single block print: one huge trade makes a thin stock look activeRILY 10/12: a 53,660-share bar flipped volume 1.37→1.92× one bar holds > 50% of the last 15 min's volumeRECORD ONLY (10/22): S3 block print -- hold while the block is in the 15-min window (2y: 49 held -0.275%, both years) thin_trading: median shares/min over 15 min ≥ floor; ignore the block bar when computing RVOL / buy share
S4Market-wide bounce: many stocks signal in the same minutes10/14: 6 buys 10:40-10:46 on a small IWM bounce, all lost ≥ 3 watched stocks signal within 5 minRECORD ONLY (10/22): [S4 CLUSTER] log, ≥ 2 other signals in 5 min + IWM directiontested (B): only 10 cases in 2 years -- low priority; record only
S5Star / references disagree right after the buyTDOC 10/20 (sold after 14 s), PGEN (67 s) Star's sell fires within 2 min of the buyHAVE (10/20): noise2 holds while ≥ VWAP and the dip is small-- (watch live)

B. Where the price is (is there room?)

#SituationExampleDetectRule todayProposed situation rule
S6Extended above the openAPPS 9/25 (+5.6%), DXC 10/5, TAL 10/12 (0.7 of its daily range) % over the open, and the same in daily ATRsV2 [S6 V2]: max 3% over the open unless a confirmed breakout; + own S6 rule (no breakout exception, record only 10/22) scale it to the stock: max 0.5-1× daily ATR over the open (v2 option ext_hard_max_atr, OFF; passed the 2-year test 10/7)
S7Stretched above VWAPPMI 10/13 (+7..18%), CERT 10/9% over VWAP V2 [S7 V2]: 0 to +2% over VWAP (loosening tested worse)scale to ATR for calm stocks (TAL: +2% = 0.7 ATR)
S8Close under resistance10/14 losers: room 2.6-7%% to the 14-day resistance V2 [S8 V2]: room ≥ 1%; + own S8 rule (5% / ATR, testing 10/22)C5 room ≥ 5% -- best of A-E (-0.103% vs -0.133%, both halves better)
S9Gap-down filling to the previous closeTAL 10/12 stalled at 12.86 = previous close gap down, price within 0.5% under the previous closeRECORD ONLY (10/22): S9 -- hold while the previous close is 0.5-3% above (2y check: 84 buys ~-0.36%)treat the previous close as resistance (room rule)
S10Late in the move: the rise confirmed after most of it is doneSNAP 10/12, ANGO / WULF 10/8 (55-75% of the rise done) move from the V low / day low vs the normal daily rangeNONE (v2 confirms late by design)max_move_x (v2 option, OFF): no buy after ≥ 1.5× the normal move so far

C. What the stock was doing before (the path)

#SituationExampleDetectRule todayProposed situation rule
S11Bounce after a sell flush (dead-cat)HPK 10/20 (9:51 flush, 44k shares) a down bar with ≥ 5× normal volume in the last 30 minNONE T3: cool-down 15-30 min AND a higher low must form before a buy
S12Opening spike, then collapse (first 15 min)SAIQ / ITG / MAX 10/9 (SAIQ -23%)minute < 15 V2 [S12]: 15-bar wait--
S13Deep V turnBRUN, ANGO, AVO 10/8-10/9V low (3 bars each side), drop ≥ 3% PARTIAL: v2 waits for a steady 15-min rise (buys late)tested as an entry: no edge (look-ahead removed); as a FILTER: V near VWAP + early + 1st V = recovers 47-50%
S14Below-VWAP recovery / VWAP reclaimAGEN 9/28, TRLVprice crossing back over VWAP V2 [S14 V2]: v2 needs ≥ 0% over VWAPVWAP-reclaim entry tested 9/29: negative -- keep blocking
S15Falling on net sellingflow study 9/28down ≥ 1% with buy share < 50% V2 [S15 V2]: v2 "falling on net selling" + buy share ≥ 55%--
S16Lower low by 10:30big-winner study 9/2710:00-10:30 low < 9:30-10:00 low avoid rule exists, OFF-0.109% alone; +0.087% on ATR ≥ 8% stocks -> test with min_atr_pct
S17Choppy stock (many Vs today)--≥ 3 Vs todayavoid rule exists, OFF-0.120% (cuts 3/4 of trades) -- low priority
S18Flat bars pinned at the lowBETR 10/8≥ 2 flat bars WITH trades near the low avoid rule exists, OFF40% keep falling vs 27% -- small effect
S19Absorption (sells hit, price holds)EV3 path Bsell > buy 3 bars, price not lower NONEEV3 tested: no edge with minute data; retest with the ORDER BOOK (bid refilling)

D. What kind of stock / day it is

#SituationExampleDetectRule todayProposed situation rule
S20Calm stockSNAP / RILY / TAL 10/12daily ATR < 8% HAVE: min_atr_pct (trade bot ON, Star OFF)threshold test 4-8% (fix #2)
S21Thin / wide-spread stockRILY 0.4%, HPK 0.9%, PMI 2-4.5%spread %, shares/min V2 [S21 V2]: spread ≤ 1%, ≥ 2,000 shares/mintighter spread (fix #4), median volume (S3)
S22Low-float squeeze / halt runnerPMI 10/13 (+56%), WFF 10/12 (halts)very thin, > 3% spread, > 20% move PARTIAL: blocked by spread / liquidity / extensionseparate "squeeze" setup with its own size / stop rules (idea, untested)
S23Steady climber on normal volumeTGB / IMMX 9/28, ABSI 10/9steady rise, volume 0.5-1.1× normal blocked by the 1.5× volume ruleloosening tested worse overall -- maybe allow only for ATR ≥ 8% (test)
S24Market falling / rising (IWM)10/14 vs 10/15IWM vs open / VWAP at the buy NONEtested: IWM at the buy does NOT predict the trade -- no rule
S25Sector move (crypto miners with bitcoin)10/15 BTC +2.7%BTC since 9:30 for crypto names NONEtested (E): no help -- no rule
S26News / SEC filing todayBETR delisting notice, offeringsnews / SEC tags recording; sec_avoid OFFnews = mover signal (scanner), not a buy signal; SEC tags need the backtest (fix #10)
S27Re-entry after a loss--a loss in the same stock todayHAVE: only above the last buy--
S28Stock in a "loser" group (group watcher)7 buys -$113.62 vs neutral +$20.38group label before the buy NONE (recording)candidate avoid filter after 2-3 more weeks

How it would work in the bot

1. Situation tagger (log only first): on every v2 buy signal, tag which situations S1-S28 the stock is in (several can apply at once).
2. Situation rules, each with its own switch and numbers (like the avoid rules): "if S1 then require T7b", "if S2 then wait and confirm", "if S11 then cool-down + higher low", "if S20 then skip"...
3. Test each situation on 2 years: how often it happens, how its buys do, and whether its rule improves THOSE buys (not the average of all buys).
4. Switch rules on one by one, as with the avoid rules.

2-year results (10/21, situations_test.py, 2,012 live-v2 buys, base -0.133%/trade)

SituationBuysPer trade (0.2% cost)vs the other buysVerdict
S20 calm (ATR < 8%)1,525-0.175%not calm: -0.003% (halves -0.16 / +0.14)BIGGEST harm -- study first
S8 room to resistance < 5%558-0.199%-0.108%, worse in both halvesharmful
S6 extended > 3% over the open66-0.450%-0.122%, both halvesharmful (rare: breakout exception)
S10 late (move > 1.5x normal)249-0.185%-0.126%mildly harmful
S16 lower low by 10:30554-0.195%-0.109% (halves disagree)unclear
S3 block print / S21 thin or wide50 / 43-0.307% / -0.369%both halves worseharmful but rare
S1 window flip101-0.078%better than averagenot harmful -- rule R1 no effect
S2 spike429-0.101%better than averagenot harmful -- waiting (R2) made it WORSE
S11 flush bounce1,095-0.119%-0.150%not harmful -- cool-down (R11) made it WORSE
S17 choppy1,530-0.137%-0.120%no difference