# 20-day configuration study: which setup to run on Monday 9/28

Every setup was run over the same **20 trading days (8/27 – 9/24)** on the stocks the fixed scanner would have picked at 9:28, using the bot's own decision code, checked once per minute. Written 9/26.

## How the test works (and its limits)
- **Data:** full-day 1-minute bars for each day's top 30 (current scanner with fixed data, and the new gap + daily ATR + RVOL ranking). Levels are the true premarket high, previous-day high, 20-day high, daily ATR and the 5-day reference.
- **Engine:** Stage 1, the trade plan, stop, giveback, stall exit, deterioration exit, re-entry rule and sizing all come from the live code (5 slots, 19% cap, 1% risk).
- **Limits, identical for every setup:** checks once per minute (the 18-second hold is waived); **no trade-flow imbalance** (needs tick data), so the imbalance exit and the context rule's imbalance check are skipped, and the above-open limit can only reach 4% (volume), not 5%; no spread check; hard stop checked against each bar's low; entries fill at the next minute's open.
- It's less exact than the tick replay, but it covers **3× more days** and treats every setup identically, so it is better for **choosing between** setups.

## Results
| Setup | Trades | Win % | **Total** | Days 1–10 | Days 11–20 | Worst day |
|---|---|---|---|---|---|---|
| **A: live config** | 44 | 45% | **−$98** | −$166 | +$68 | −$105 |
| B: + low-ceiling rule | 44 | 45% | −$98 | −$166 | +$68 | −$105 |
| E: + recent-trend deterioration | 44 | 45% | −$98 | −$166 | +$68 | −$105 |
| F: + dead money | 44 | 52% | −$49 | −$128 | +$79 | −$105 |
| G: + 5-day levels | 37 | 41% | −$96 | −$213 | +$118 | −$63 |
| **C: + above-open limit (your 3–5% rule)** | 21 | 48% | **+$45** | −$135 | +$180 | −$63 |
| **J: + above-open limit + R:R ≥ 2** | **10** | **60%** | **+$103** | **−$21** | **+$123** | −$40 |
| K: + above-open limit + no entries before 10:00 | 14 | 50% | +$75 | −$109 | +$184 | −$47 |
| L: J + no entries before 10:00 | 5 | 80% | +$136 | −$9 | +$146 | −$22 |
| M: L + pullbacks only | 5 | 80% | +$136 | −$9 | +$146 | −$22 |
| I: without real-level targets | 26 | 50% | +$68 | −$25 | +$93 | −$31 |
| H: without context rules | 88 | 45% | −$169 | −$45 | −$124 | −$137 |
| *New scanner ranking:* A / C / J / K / L / G / H | 44 / 22 / 11 / 13 / 5 / 39 / 93 | | −$94 / **+$103** / +$86 / +$97 / +$110 / +$1 / −$378 | | | |

## Patterns across 181 trades (the setups without context rules, for sample size)
| What | Good | Bad |
|---|---|---|
| Setup | Pullbacks: about breakeven (147) | **Breakouts: −$532** (34, 35% winners) |
| Entry time | **10:00–10:30: +$230** | **9:30–10:00: −$441**; 11:30–13:00: −$252 |
| Above the open at entry | **0–3%: +$122** | **3–10%: −$624** |
| Above VWAP at entry | **1–2%: +$221** | 2–4%: −$536 |
| R:R at entry | ≥ 2: about breakeven | **1.5–2: −$541** |
| Volume pace | **3–10× normal: +$285** | < 3× or > 10×: losing |
| Target | **20-day high: +$460 (64%)** | previous-day high: −$581 |
| Exit | **Giveback +$1,665; stall exit +$210 (90%)** | hard stop −$1,787; deterioration −$624 |

## What the study says
1. **Keep the context rules.** Removing them was the worst setup on both scanners.
2. **Your above-open limit works over 20 days.** Entries 3–10% above the open were the biggest losing group, and C beat A in **both** halves. This reverses the 6-day tick result, which was dominated by a few strong trend days.
3. **Raising the minimum R:R to 2** removes the worst R:R group (1.5–2, −$541). J beat A in **both** halves by a wide margin, with the smallest first-half loss of any setup with a normal number of trades.
4. **No entries before 10:00** also helps, but combined with J (setup L) it leaves only **5 trades in 20 days**. That's too few to trust, and the bot would sit idle most days.
5. **The exits aren't the problem.** Giveback and the stall exit make the money; the losses are bad entries hitting the stop.
6. **Every setup lost in the first 10 days** (8/27–9/10) and made money in the last 10. Market conditions matter a lot. A market filter (no longs while small caps fall, from the 9/24 review) is worth building next.
7. **New scanner ranking:** better for A and C, slightly worse for J and L. Not a clear enough win to switch yet.

## Recommendation for Monday 9/28 (needs your approval)
**Setup J = the live config + the above-open limit + minimum R:R 2.0.** It beat the live config in both halves of the 20 days, had the most consistent daily results with a usable number of trades, and both changes are one-line settings:
- `smart_engine.max_extension_from_open.enabled: true`
- `setup_plan.min_reward_risk: 2.0`

**Expect far fewer trades:** about 1 every 2 days in this test (the live bot may take a few more, since live data allows the 5% band with strong buying). Keep the current scanner. Leave the low-ceiling rule, dead money, recent-trend deterioration and 5-day levels off.

**Caution:** the patterns came from the same 20 days they were tested on, and J made only 10 trades, so this is the best-supported choice, not a proven one. Watch the first week's live results against this study.

Files: `reports/open_window/bar_backtest.py`, `bar_data_build.py`, `results/*.json`.
