# Trader Filter Mine — Readable IF/THEN Rules _Holdout: `train date < 2026-06-01; test >= 2026-06-01`. Positives = Satya trader-log takes; negatives = same strategy-family triggers not in the log._ ## Goal Find **concrete filters** that separate mostly-profitable logged option-buyer trades from **similar setups that lose if taken indiscriminately**, vs prior OOS-negative systems (atm-daily-sr-optbuyer, confluence-v1, price-action-v2 AMD/trap/retest). ## Sample & method - Feature rows: **3001** (taken=194, skipped=2807) - Options 1m coverage: 2024-08-23 -> 2026-09-29 (July 2024 log trades spot-only aligned) - Models: Decision tree (depth<=4, min_leaf=25) + GB (depth2, lr0.05) + hypothesis association rules (honest holdout AUC ~0.57 after removing family-leakage features — trees alone are weak; **hypothesis rules below are the deliverable**) - DT holdout: P=0.15 R=0.13 AUC=0.57 - GB holdout: P=0.06 R=0.01 AUC=0.58 - Overall: taken sim avg **+3.40** opt-pts vs skipped **+1.40**; taken log WR **77%** ### Caveats - Trader log has no exact entry timestamps — bars aligned via strategy-family detectors / premium / window midpoint. - Sensex rows mapped to Nifty ATM same side — strike-level precision is approximate. - Negatives are synthetic detectors, not the trader's actual watchlist rejects. - Sample size small (~200 taken); holdout metrics unstable — treat rules as hypotheses. - Simulated skipped outcomes use ATM option SL10/TP10/EOD — not full SL10 scale-out book. - Log eras discontinuous (Jul-Sep 2024, May-Jul 2026); middle period lightly sampled. - Tree/GB AUC is modest once leaky `fam_other` is removed; trust **lift + skipped expectancy** more than model scores. - SL10/TP10/EOD sim is a proxy, not the full SL10 scale-out book. ## Ranked IF/THEN rules **precision_taken** = P(in log | rule fires). **skip_sim** = ATM option SL10/TP10/EOD on fires that were NOT logged. ### R1. [TAKE] Black-box / round-level ONLY with rejection wick (non-midday) **IF/THEN:** IF (black_box family OR price within 15pts of round-50) AND ((PE with upper_wick_frac > 0.40) OR (CE with lower_wick_frac > 0.40)) AND NOT midday (10:45–13:45) THEN take ATM option on that side. - Holdout: n=41, prec_taken=0.46, taken=19, skip_sim_WR=0.59, skip_sim_avg=1.47, fires/day≈1.00 - Train: n=283, prec_taken=0.09, taken_log_WR=0.85 - All-era skipped sim: n=280, avg_pts=-0.24, WR=0.44, PF=0.94 - Why it matters: RAW black_box skips average −0.86 opt-pts (WR 41%) — the clearest “indiscriminate lose” bucket. Log takes in this family have ~76–85% win rate. ### R2. [TAKE] 3PM Matka PE after sweep or afternoon sell momentum **IF/THEN:** IF family is 3PM/Matka AND side is PE AND time ≥ 14:45 IST AND (aligned_sweep of morning/prior high OR mom15 < −15) THEN take PE. - Holdout: n=21, prec_taken=0.38, taken=8, skip_sim_WR=0.69, skip_sim_avg=4.76, fires/day≈0.51 - Train: n=42, prec_taken=0.14, taken_log_WR=0.83 - All-era skipped sim: n=49, avg_pts=3.91, WR=0.63, PF=2.79 - Why it matters: Holdout precision_taken ≈ 0.38; taken log WR ≈ 0.86. Prefer PE matka over CE (CE matka taken WR only ~0.43 in assoc table). ### R3. [TAKE] Expiry-day PE in matka window **IF/THEN:** IF is_expiry_day AND side is PE AND time ≥ 14:45 THEN take PE (ATM). - Holdout: n=13, prec_taken=0.31, taken=4, skip_sim_WR=0.78, skip_sim_avg=4.71, fires/day≈0.32 - Train: n=27, prec_taken=0.30, taken_log_WR=0.75 - All-era skipped sim: n=28, avg_pts=2.63, WR=0.61, PF=2.00 - Why it matters: Highest association lift (~4.6× base rate). Still small n — treat as boost on top of R2. ### R4. [TAKE] Breakdown retest PE with premium floor + negative mom **IF/THEN:** IF breakdown_retest AND PE AND mom5 < 0 AND pct_in_day_range ≥ 0.40 AND premium ≥ 80 THEN take PE. - Holdout: n=6, prec_taken=0.33, taken=2, skip_sim_WR=0.75, skip_sim_avg=5.00, fires/day≈0.15 - Train: n=3, prec_taken=0.67, taken_log_WR=1.00 - All-era skipped sim: n=5, avg_pts=6.00, WR=0.80, PF=4.00 - Why it matters: Avoid dust premiums and “already at day low” exhausted breakdowns. Small sample but high taken WR. ### R5. [TAKE] Opening gap CONTINUATION (do not fade large gaps) **IF/THEN:** IF minutes_from_open < 45 AND ((gap > +30 AND CE AND bullish body_frac > 0.45) OR (gap < −30 AND PE AND bearish body_frac > 0.45)) THEN take with gap direction. - Holdout: n=95, prec_taken=0.07, taken=7, skip_sim_WR=0.66, skip_sim_avg=3.18, fires/day≈2.32 - Train: n=173, prec_taken=0.03, taken_log_WR=1.00 - All-era skipped sim: n=255, avg_pts=3.04, WR=0.64, PF=1.90 - Why it matters: Log BTST/gap rows favor continuation. Skipped gap-continuation still +3pt avg on SL10/TP10 — edge is direction, not rarity. ### R6. [TAKE] Liquidity-sweep / AMD fade only at session edges with aligned sweep **IF/THEN:** IF family in {liquidity_sweep, amd} AND aligned_sweep=1 AND body_frac ≥ 0.40 AND (mfo < 120 OR mfo > 270) THEN take fade side. - Holdout: n=23, prec_taken=0.13, taken=3, skip_sim_WR=0.50, skip_sim_avg=0.85, fires/day≈0.56 - Train: n=82, prec_taken=0.05, taken_log_WR=1.00 - All-era skipped sim: n=98, avg_pts=1.14, WR=0.53, PF=1.30 - Why it matters: Unfiltered AMD/retail-trap books were OOS disasters (WR ~12–19%). This filter cuts fires sharply; remaining taken WR high but precision_taken still low — use as veto on midday sweeps, not standalone alpha. ### R7. [SKIP] SKIP: Indiscriminate black-box / premium S/R without wick **IF/THEN:** IF black_box family AND upper/lower rejection wick is weak (wick_frac ≤ 0.40 on the signal side) THEN SKIP. - Holdout: n=3, prec_taken=1.00, taken=3, skip_sim_WR=NA, skip_sim_avg=NA, fires/day≈0.07 - Train: n=89, prec_taken=0.00, taken_log_WR=NA - All-era skipped sim: n=89, avg_pts=-0.16, WR=0.46, PF=0.96 - Why it matters: This is the anti-pattern behind atm-daily-sr-optbuyer / broad S/R: skipped avg ≈ −1.4 pts, WR ~39%. ### R8. [SKIP] SKIP: Midday support-bounce far from day low **IF/THEN:** IF support_bounce AND CE AND pct_in_day_range > 0.40 AND in_midday THEN SKIP. - Holdout: n=0, prec_taken=NA, taken=0, skip_sim_WR=NA, skip_sim_avg=NA, fires/day≈0.00 - Train: n=39, prec_taken=0.00, taken_log_WR=NA - All-era skipped sim: n=39, avg_pts=1.79, WR=0.59, PF=1.44 - Why it matters: Bounces not anchored near the day/prior low are retail traps in the log narrative; broad bounce books bled. ## Smoking-gun contrast (indiscriminate vs filtered) | Bucket | skip n | skip avg opt-pts | skip WR | taken log WR | |---|---:|---:|---:|---:| | RAW black_box (no filter) | 500 | -0.86 | 0.41 | 0.77 | | R1 filtered black_box/round wick | 280 | -0.24 | 0.44 | 0.85 | | RAW 3pm PE | 57 | 3.40 | 0.63 | 0.84 | | R2 filtered 3pm PE | 49 | 3.91 | 0.63 | 0.86 | | RAW liq_sweep/AMD | 530 | 0.55 | 0.52 | 0.79 | | R6 filtered sweep edge | 98 | 1.14 | 0.53 | 1.00 | | R7 SKIP: black_box weak wick | 89 | -0.16 | 0.46 | 1.00 | ## Contrast vs prior failing broad systems - **atm-daily-sr-optbuyer**: OOS n=476, WR=47.27%, net_pts=-715.0 — Broad ATM S/R bounce without trader filters - **confluence-v1**: OOS n=20, WR=25.0%, net_pts=-83.8 — Trap+AMD+premium confluence too rare / still red - **price-action-v2 AMD**: OOS n=212, WR=12.26%, net_pts=-2066.7 — Indiscriminate AMD - **price-action-v2 RETAIL_TRAP**: OOS n=494, WR=19.0%, net_pts=-4174.4 — Indiscriminate sweep reclaims - **price-action-v2 BO_RETEST**: OOS n=275, WR=17.8%, net_pts=-2755.4 — Indiscriminate breakout retests **Interpretation:** broad S/R bounce / AMD / trap / retest books fire the RAW buckets above. Trader filters (wick rejection, 3PM PE+sweep, session-edge only, premium floor, gap continuation not fade) are exactly what those systems lacked. ## Association leaderboard | Hypothesis | n | taken | prec | recall | lift | skip_sim_WR | taken_WR | |---|---:|---:|---:|---:|---:|---:|---:| | Expiry PE matka | 40 | 12 | 0.30 | 0.06 | 4.6 | 0.61 | 0.75 | | Black box / round wick | 324 | 44 | 0.14 | 0.23 | 2.1 | 0.44 | 0.85 | | 3PM PE matka + sweep/mom | 63 | 14 | 0.22 | 0.07 | 3.4 | 0.63 | 0.86 | | Breakdown retest PE mom< | 204 | 26 | 0.13 | 0.13 | 2.0 | 0.69 | 0.87 | | 3PM CE matka | 54 | 10 | 0.19 | 0.05 | 2.9 | 0.73 | 0.43 | | Midday other/breakout (avoid) | 71 | 11 | 0.15 | 0.06 | 2.4 | 0.85 | 0.50 | | Liq sweep/AMD + aligned + edge hours | 105 | 7 | 0.07 | 0.04 | 1.0 | 0.53 | 1.00 | | Open gap continuation | 268 | 13 | 0.05 | 0.07 | 0.8 | 0.64 | 1.00 | | Support bounce CE near low | 54 | 3 | 0.06 | 0.02 | 0.9 | 0.39 | 0.33 | | AMD PE morn high sweep | 69 | 3 | 0.04 | 0.02 | 0.7 | 0.56 | 1.00 | | Power-hour PE momentum | 44 | 1 | 0.02 | 0.01 | 0.4 | 0.65 | 0.00 | | High-vol aligned sweep | 38 | 0 | 0.00 | 0.00 | 0.0 | 0.61 | NA | ## Top GB importances (leakage-fixed) - `atr20`: 0.2758 - `atr_pctile`: 0.1036 - `mom15`: 0.0995 - `gap_abs`: 0.0674 - `prem_vs_morn`: 0.0635 - `dist_day_lo`: 0.0491 - `fam_3pm_matka`: 0.0446 - `is_expiry`: 0.0389 - `upper_wick_frac`: 0.0387 - `pct_in_morn_range`: 0.0274 - `dist_day_hi`: 0.0230 - `fam_breakout`: 0.0226 ## Optional re-backtest (SL10 / TP10 proxy) - **Do ship as entry filters**, not a standalone grid-searched book. - Strongest “beats indiscriminate” case: **R1 vs RAW black_box** (skip avg −0.86 → filtered still negative on skips but holdout prec_taken 0.46 and taken WR high). - R2/R5 skipped sims are still positive on SL10/TP10 — filter mainly raises **overlap with how Satya actually trades**, not a free lunch vs all candidates. - Full SL10 scale-out (40%@+10 / 30%@+20 / trail) not re-run here; wire R1–R6 as gates on atm-daily-sr-optbuyer / confluence engines. ## Files - `results/features.parquet` / `.csv` — feature table - `results/model_notes.json`, `decision_tree.txt`, `feature_importance_gb.csv` - `results/rules_metrics.csv`, `rules.json`, `association_candidates.csv` - `summary.html` — this report