{
  "title": "Trading Rules Book",
  "subtitle": "Entry situations, avoid rules and the do-not-trade list -- what we know so far",
  "notes": [
    "All results: real v2 bar replay, every signal, daily top-30 lists, 2 years (2024-10-01 .. 2026-10-02, 457-503 days), after the real 0.2% cost per round trip, unless the row says otherwise.",
    "Base = today's live v2 rules: 2,012 buys, -0.133% per trade, halves -0.193% / -0.074%, total -267.5%.",
    "Situation rule = 'not now': it only stops the buy at that moment; the next finished bars and v2 decide whether to buy later. Judged on: did it catch the case, did it leave everything else unchanged.",
    "Status words: RECORD ONLY = logged in both bots, no trade changes; V2 = the situation's rule is an existing v2 check (logged '[Sx V2]' when v2 holds a buy only for it); AVOID = an avoid rule (avoid_rules.py); NONE = no rule."
  ],
  "situations": [
    [
      "S1",
      "Window flip from a sell flush leaving the 15-min window",
      "HPK 10/20 (buy share 31%->61% in 1 min; -$47)",
      "v2 rejected the minute before; buy share up >= 20 pts or straightness up >= 0.3; a >= 3x SELL-FLUSH bar just left the window",
      "RECORD ONLY (10/21). Hold until buyers since the flush (flush included) >= 55%, or +0.3% over 5 bars with buyers >= 55%; max 15 min",
      "2y: held 20 buys, 14 losers (70%) incl. BKKT/OPFI/NMAX -1.2%; 1,992 other buys unchanged. HPK held 10:06-10:09 with live numbers."
    ],
    [
      "S2",
      "Weak 1-2 minute spike (pop and fade)",
      "NVAX 10/9, PMI 10/13",
      "range > 2x the normal 1-min range in the last 2 bars AND a down bar, or sellers > 60%, or closed in the lower 2/3",
      "RECORD ONLY (10/21). Hold until every close since the spike >= its middle with buyers >= 55%; max 10 min",
      "2y: weak-spike buys 106, -0.276% (61% faded in 2 bars); strong spikes -0.073% (left alone). Held 88 -0.238% (y1 -0.45 / y2 -0.07); total -267.5% -> -255.2%. 'Latest close' confirmation tested worse (-262.8%)."
    ],
    [
      "S3",
      "Single block print",
      "RILY 10/12 (53,660-share bar: volume 1.37x -> 1.92x)",
      "one bar > 50% of the last 15 min's volume",
      "RECORD ONLY (10/22), mode while_in_window: hold every buy while the block is inside the 15-min window",
      "2y: 50 block-print buys -0.307% (both halves). Held 49, -0.275% (y1 -0.23 / y2 -0.32), 73% losers; total -255.4%. Mode 'fails without the block' weaker (-263.8%)."
    ],
    [
      "S4",
      "Market-wide bounce (many stocks signal at once)",
      "10/14: 6 buys 10:40-10:46 on a small IWM bounce, all lost",
      ">= 2 other watched stocks gave a v2 BUY in the last 5 min",
      "RECORD ONLY log [S4 CLUSTER] with the IWM 15-min change (10/22)",
      "2y: clustering alone is not harmful (>= 1 other buy: -0.024%); >= 2 others + IWM falling: 10 buys -0.379% (too few). S1/S2/S3 catch 0/2/1 of 55 clustered buys."
    ],
    [
      "S5",
      "Sell fires right after the buy",
      "TDOC 10/20 (14 s), PGEN (67 s)",
      "exit signal within 2 min of the buy",
      "Star bot: noise2 (live 10/20 10:54). Trade bot: none",
      "Star: 4 quick sells in 39 trades before noise2, 0 in 6 after; daily record Star sells -13.3% vs with noise2 -4.5% (45 trades). Trade bot: 34 of 496 buys sold within 2 min (23 stop-outs, -0.619%) -- a stop-placement question, not tested."
    ],
    [
      "S6",
      "Extended above the open",
      "APPS 9/25 (+5.6%), DXC 10/5, TAL 10/12",
      "> 3% over the open (only possible via v2's breakout exception)",
      "V2: max 3% unless a confirmed breakout. + own S6 RECORD ONLY (10/22): fixed 3%, no exception",
      "2y: 66 buys -0.450% (both halves). S6 3% held 56, -0.345% (y1 -0.29 / y2 -0.42), 75% losers; total -252.2%. ATR line (1x daily ATR): -258.1%."
    ],
    [
      "S7",
      "Stretched above VWAP",
      "PMI 10/13 (+7..18%), CERT 10/9",
      "% over VWAP",
      "V2: 0 to +2% over VWAP (logged [S7 V2])",
      "Loosening the band tested worse. Inside 0..+2% being farther is NOT worse: 0-0.5% over VWAP is the worst (-0.201%, 80% come back to VWAP). ATR / 1-min-range / slope versions: no consistent signal. No extra rule."
    ],
    [
      "S8",
      "Close under resistance",
      "10/14 losers (room 2.6-7%)",
      "room to the 14-day resistance band",
      "RECORD ONLY (10/22): need 5% room to the 14-day resistance (v2 itself: 1%); hold until the level breaks",
      "2y: 558 buys < 5% room -0.199% (both halves). S8 5% held 575 buys -0.187% (halves -0.24 / -0.14); total -267.5% -> -149.4% (-0.103%/trade); 9 buys after the break +1.16%. ATR 0.5x -195.8%, 1x -151.0%. Levels touched 5+ times: held -0.357%."
    ],
    [
      "S9",
      "Gap-down stock climbing to the previous close",
      "TAL 10/12 stalled at 12.86 = previous close",
      "opened under the previous close; previous close 0.5-3% above the price",
      "RECORD ONLY (10/22)",
      "2y check (base buys): this zone 84 buys about -0.36%, both years; only 11-14% broke the previous close within 60 min. Prev close 0-0.5% above: +0.14% (17 buys, 65% broke through). Gap-down buys overall -0.007% (better than gap-up -0.172%)."
    ],
    [
      "S10",
      "Late in the move",
      "SNAP 10/12, ANGO / WULF 10/8 (55-75% of the rise done)",
      "move from the open vs the normal daily move",
      "NONE (v2 option max_move_x exists, OFF)",
      "Not tested as a situation yet -- candidate."
    ],
    [
      "S11",
      "Bounce after a sell flush (dead cat)",
      "HPK 10/20 (9:51 flush, 44k shares)",
      "a down bar >= 5x normal volume in the last 30 min",
      "NONE (S1 covers the flush-leaving-the-window case)",
      "Cool-down 15 / 30 min + higher low tested worse (later buys -0.35% / -0.29%)."
    ],
    [
      "S12",
      "Opening spike, then collapse (first 15 min)",
      "SAIQ / ITG / MAX 10/9 (SAIQ -23%)",
      "minute < 15",
      "V2: 15-bar wait",
      "--"
    ],
    [
      "S13",
      "Deep V turn",
      "BRUN, ANGO, AVO 10/8-10/9",
      "V low, drop >= 3%",
      "PARTIAL: v2 waits for a steady rise (buys late)",
      "As an entry: no edge once a 2-bar look-ahead was fixed. V-styles (A1 BRUN, B1 ABSI): recovery predictable, trades lose (too little room after the cost)."
    ],
    [
      "S14",
      "Below VWAP / VWAP reclaim",
      "AGEN 9/28, TRLV",
      "price crossing back over VWAP",
      "V2: price >= VWAP (logged [S14 V2])",
      "VWAP-reclaim entry negative in every variant (9/29)."
    ],
    [
      "S15",
      "Falling on net selling",
      "flow study 9/28",
      "down >= 1% with buy share < 50%",
      "V2: buy share >= 55% + 'falling on net selling' (logged [S15 V2])",
      "Keeps falling -0.58% / -0.70% over the next 60 min, both halves."
    ],
    [
      "S16",
      "Lower low by 10:30",
      "big-winner study 9/27",
      "10:00-10:30 low < 9:30-10:00 low",
      "AVOID rule lower_low_by_1030, OFF",
      "Alone: 1,458 buys -0.109% (halves -0.21 / -0.01); on ATR >= 8% stocks +0.087%."
    ],
    [
      "S17",
      "Choppy stock (many Vs)",
      "--",
      ">= 3 Vs today",
      "AVOID rule choppy_many_vs, OFF",
      "Alone: 482 buys -0.120% (cuts 3/4 of trades)."
    ],
    [
      "S18",
      "Flat bars pinned at the low",
      "BETR 10/8",
      ">= 2 flat bars with trades near the 30-bar low",
      "AVOID rule flat_bars_at_low, OFF",
      "40% keep falling vs 27%; replay -0.131% (little effect)."
    ],
    [
      "S19",
      "Absorption (sells hit, price holds)",
      "EV3 path B",
      "sell > buy 3 bars, price not lower",
      "NONE",
      "EV3 no edge on minute data (-0.21%); retest with order-book data (recording since 10/12)."
    ],
    [
      "S20",
      "Calm stock",
      "SNAP / RILY / TAL 10/12",
      "daily ATR < 8%",
      "AVOID min_atr_pct: trade bot ON, Star OFF",
      "ATR >= 8% buys: 411, -0.007% (halves -0.20 / +0.18) vs -0.133% all."
    ],
    [
      "S21",
      "Thin or wide spread",
      "RILY 0.4%, HPK 0.9%, PMI 2-4.5%",
      "spread %, shares per minute",
      "V2: spread <= 1%, >= 2,000 shares/min (logged [S21 V2])",
      "Tagged buys 43, -0.369% (both halves). Tighter spread = fix #4."
    ],
    [
      "S22",
      "Low-float squeeze / halt runner",
      "PMI 10/13 (+56%), WFF 10/12",
      "very thin, > 3% spread, > 20% move",
      "PARTIAL: blocked by spread / liquidity / extension",
      "Separate setup with its own size and stop -- idea, untested."
    ],
    [
      "S23",
      "Steady climber on normal volume",
      "TGB / IMMX 9/28, ABSI 10/9",
      "steady rise, volume 0.5-1.1x normal",
      "blocked by v2's 1.5x volume rule",
      "Loosening volume for all: worse. Only for ATR >= 8%: untested."
    ],
    [
      "S24",
      "Market falling / rising (IWM)",
      "10/14 vs 10/15",
      "IWM vs open / VWAP at the buy",
      "NONE",
      "Tested (A1/A2): IWM at the buy does not predict the trade."
    ],
    [
      "S25",
      "Sector move (crypto with bitcoin)",
      "10/15 BTC +2.7%",
      "BTC since 9:30 for crypto names",
      "NONE",
      "Tested (E): no help."
    ],
    [
      "S26",
      "News / SEC filing today",
      "BETR delisting notice, offerings",
      "news / SEC tags",
      "recording; sec_avoid OFF",
      "News = mover signal (scanner), not a buy signal. SEC tags need the backtest (fix #10)."
    ],
    [
      "S27",
      "Re-entry after a loss",
      "--",
      "a loss in the same stock today",
      "HAVE: buy again only above the last buy",
      "Better on all 4 test days (9/23); live since."
    ],
    [
      "S28",
      "Stock in a 'loser' group",
      "group watcher",
      "group label before the buy",
      "NONE (recording)",
      "7 buys -$113.62 vs neutral +$20.38; groups did not hold out of sample (10/9)."
    ]
  ],
  "avoid_rules": [
    [
      "min_atr_pct",
      "calm stock: daily ATR < 8%",
      "trade bot ON, Star OFF",
      "411 buys, -0.007% (halves -0.20 / +0.18)",
      "best single rule"
    ],
    [
      "max_gap_pct",
      "gap over the previous close > 10%",
      "OFF",
      "1,797 buys, -0.139%",
      "no help"
    ],
    [
      "no_buy_before",
      "before 9:45",
      "OFF",
      "no effect (v2's 15-bar wait already covers)",
      "not needed"
    ],
    [
      "no_buy_after",
      "after 14:30",
      "OFF",
      "1,826 buys, -0.152% (late buys were better than average)",
      "worse"
    ],
    [
      "max_vwap_pct",
      "more than 2% over VWAP",
      "OFF",
      "no effect (v2 already 0..+2%)",
      "not needed"
    ],
    [
      "max_above_open_pct",
      "more than 3% over the open, no breakout exception",
      "OFF (same as S6)",
      "1,961 buys, -0.129%, total -252.2%; removed 56 at -0.345%",
      "helps (S6)"
    ],
    [
      "breakout_exception",
      "buy passed only through v2's breakout exception",
      "OFF",
      "same as max_above_open_pct",
      "helps (S6)"
    ],
    [
      "heavy_volume",
      "last-15-min volume > 3x normal",
      "OFF",
      "1,652 buys, -0.190%",
      "worse"
    ],
    [
      "recent_climax",
      "a >= 10x volume bar in the last 30 min",
      "OFF",
      "1,119 buys, -0.186%",
      "worse"
    ],
    [
      "net_selling_drop",
      "down >= 1% in 15 min with buy share < 50%",
      "OFF",
      "no effect (v2 already covers)",
      "not needed"
    ],
    [
      "lower_low_by_1030",
      "from 10:30: the 10:00-10:30 low broke the 9:30-10:00 low",
      "OFF",
      "1,458 buys, -0.109% (halves -0.21 / -0.01); ATR >= 8%: +0.087%",
      "small help; pair with min_atr"
    ],
    [
      "choppy_many_vs",
      ">= 3 Vs today",
      "OFF",
      "482 buys, -0.120%",
      "small help, cuts 3/4 of trades"
    ],
    [
      "flat_bars_at_low",
      ">= 2 flat bars with trades near the 30-bar low",
      "OFF",
      "1,944 buys, -0.131%",
      "little effect"
    ],
    [
      "sec_avoid",
      "SEC filing tagged 'avoid' today / 1 day back",
      "OFF (live only)",
      "not testable in the replay",
      "needs the SEC backtest"
    ],
    [
      "ALL ON together",
      "--",
      "--",
      "18 buys, -0.473%",
      "do not combine blindly"
    ]
  ],
  "do_not_trade": [
    [
      "A1",
      "Price more than ~2% above VWAP (stretched)",
      "Stop hit first 40-48% vs 25% below VWAP (3 studies 9/26-9/27); loosening to +3% or 0.3x ATR: extra trades -0.26% / -0.29% (2 years, 10/9)",
      "strong"
    ],
    [
      "A2",
      "Calm stock: daily ATR under ~8%",
      "ATR >= 8% about break-even (+0.02%) vs -0.16% calm (2 years, 10/10)",
      "strong"
    ],
    [
      "A3",
      "Volume rule fails (volume so far < 1.5x normal)",
      "Looser 1.2x / 1.0x / off: extra trades -0.21% to -0.23%, both halves (10/9)",
      "strong"
    ],
    [
      "A4",
      "Rise not steady (15-min smoothness < 0.7 / straightness < 0.5)",
      "Looser 0.6/0.4 or 0.5/0.35: extra trades -0.23% to -0.33% (10/9)",
      "strong"
    ],
    [
      "A5",
      "More than 3% above the open (unless a real confirmed breakout)",
      "ATR-based loosening: extra trades -0.18% to -0.27%; S6 2y: 66 buys -0.450%",
      "strong"
    ],
    [
      "A6",
      "Falling on net selling (down >= 1%, sellers dominating)",
      "Keeps falling -0.58% / -0.70% in 60 min, both halves, 660 stock-days (9/28)",
      "strong"
    ],
    [
      "A7",
      "Late in the day (after ~14:30)",
      "Buys after 14:30 median -0.36%; late +2% touches reach +5% only 4%; late Vs recover 7-9%",
      "strong"
    ],
    [
      "A8",
      "First 15 minutes (before 9:45)",
      "15-bar wait blocked SAIQ / ITG / MAX spikes that collapsed (SAIQ -23%); 9:30-10:00 entries -$441 (20 days)",
      "medium"
    ],
    [
      "A9",
      "Heavy volume spikes / climax bars / high acceleration",
      "Fade AUC 0.41-0.42; climax events -21% to the close (5 cases); X1 climax exit built on it",
      "medium"
    ],
    [
      "A10",
      "Gap over ~10%",
      "Gaps > 10% faded ~-8% from the open (21 days, 9/27); gaps 5-10% best",
      "medium (small)"
    ],
    [
      "A11",
      "A lower low by 10:30",
      "Only 2% became +5% winners vs 58 of 63 winners holding a higher low (9/27)",
      "medium (small)"
    ],
    [
      "A12",
      "Spread over 1% or under 2,000 shares/min",
      "Live guards since 9/28 and 10/7; S21 tagged buys -0.369% both halves",
      "rule kept"
    ],
    [
      "A13",
      "A V far below VWAP, late, or the 3rd+ V of the day",
      "Opening-spike Vs > 5% under VWAP: 80% stay weak; V after 13:10: 7-9% recover (2 years, 10/11)",
      "strong (filter)"
    ],
    [
      "A14",
      "Flat bars with trades right at the low",
      "40% keep falling vs 27% (125k Vs, 10/11)",
      "medium"
    ],
    [
      "A15",
      "Breakout buys (vs pullbacks); re-buys below a losing trade's entry",
      "Breakouts -$532 vs pullbacks ~0 (20 days); ORB 12 variants all lose (503 days)",
      "medium"
    ],
    [
      "A16",
      "SEC filing: offering / dilution / delisting notice",
      "Recording since 10/7; needs the SEC tag backtest",
      "untested"
    ],
    [
      "A17",
      "Weak 1-2 minute spike (S2)",
      "106 buys -0.276%, 61% faded within 2 bars (2 years, 10/21)",
      "medium"
    ],
    [
      "A18",
      "A block print in the 15-min window (S3)",
      "50 buys -0.307%, both halves (2 years, 10/22)",
      "medium"
    ],
    [
      "A19",
      "Under 5% room to the 14-day resistance (S8)",
      "558 buys -0.199%, both halves; need 5%: -0.103%/trade (2 years)",
      "medium"
    ],
    [
      "A20",
      "Gap-down stock 0.5-3% under the previous close (S9)",
      "84 buys about -0.36%, both years; only 11-14% broke through in 60 min (10/22)",
      "medium (small)"
    ]
  ],
  "changelog": [
    [
      "2026-10-22",
      "First version: situations S1-S28, 14 avoid rules, do-not-trade list A1-A20 (A17-A20 added from the S2/S3/S8/S9 studies)."
    ],
    [
      "2026-10-22",
      "Added section 4: worked examples -- the 5 most recent big losers vs the current rules."
    ],
    [
      "2026-10-22",
      "S8 set to 5% room, record only, both bots (2-year test: total -267.5% -> -149.4%)."
    ]
  ],
  "worked_examples_note": "The 5 most recent BIG LOSERS in the 2-year replay (a buy that lost >= 0.5% although the stock later rose >= 2% above the buy that day), replayed 3 ways: TODAY = live v2; +SIT = situations S1, S2, S3, S6, S8 (5%), S9 ON as holds; +SIT+AVOID = also min_atr 8%, lower low by 10:30, choppy. Result: the situation rules (mostly S8) skip 4 of 5 losers, but no rule buys the day's low -- the swing is not captured. Script: reports/playbook/big_losers_check.py (10/22).",
  "worked_examples": [
    [
      "2026-09-01 PCG",
      "10:13 at 13.29, -1.20% (stop)",
      "13.09 (9:59) -> 14.79 (14:18) = +13.0%",
      "+3.12% (loser + 2 winners)",
      "+3.12% (no situation flagged it)",
      "0% (min_atr also blocked the +3.77% winner)",
      "calm (ATR 6.7%), S11 flush, S17 choppy"
    ],
    [
      "2026-09-18 DSP",
      "12:07 at 11.78, -1.20% (stop)",
      "11.32 (9:46) -> 12.41 (15:38) = +9.6%",
      "+0.02% (loser + one +1.22% winner)",
      "0% -- held by S8",
      "0%",
      "gap +15%, S8 under resistance, S11, S17, calm"
    ],
    [
      "2026-09-18 AGEN",
      "14:40 at 7.66, -0.56%",
      "7.33 (11:24) -> 7.88 (15:59) = +7.5%",
      "-0.96% (2 small losers)",
      "0% -- held by S8 and S2",
      "0%",
      "S8, S11, S16 lower low, S17, calm, thin"
    ],
    [
      "2026-09-28 QTTB",
      "9:58 at 9.11, -1.20% (stop)",
      "8.96 (9:46) -> 9.45 (12:24) = +5.4%",
      "-1.20%",
      "0% -- held by S8",
      "0%",
      "S8, S11, calm"
    ],
    [
      "2026-10-01 KD",
      "13:09 at 12.03, -0.57%",
      "11.59 (11:04) -> 12.53 (13:41) = +8.1%",
      "-0.57%",
      "0% -- held by S8",
      "0%",
      "S8, S11, S17, calm (ATR 4.8%)"
    ],
    [
      "TOTAL",
      "-3.53% in the 5 losing buys",
      "",
      "+0.41%",
      "+3.12%",
      "0.00%",
      "common: calm stocks, a recent sell flush, buying under resistance"
    ]
  ]
}