# The RSI(2) Dip Buyer (code name ESH1 RSI(2) Pullback) - frozen specification (RIP Backtest protocol v1.0)

Specification date for this protocol run: **2026-10-07**, written BEFORE `rsi2_protocol.js` was run on any data.

## Provenance of the rules
The strategy rules are those of `ESH1Rsi2Pullback.cs` (NinjaTrader), which were written on **2026-09-27 before any
data was viewed** and have not changed. Nothing has been fitted or optimised. This is a LEGACY test: it predates
the protocol page, and its data was first looked at in stages (see "Data history"). The JS engine is a port of the
NinjaScript so that the random-entry control can be run; the engine is checked against the earlier NinjaTrader
numbers before any new result is read.

## Rules (60-minute ES bars, bar time = close time, New York wall clock)
- Indicators on hourly closes: SMA(200), SMA(5), RSI(2) (Wilder), ATR(14) (Wilder).
- Long when Close > SMA(200) and RSI(2) < 10. Short when Close < SMA(200) and RSI(2) > 90.
- Entries only on bars that close between 10:00 and 16:00 New York (inclusive). One position at a time.
- Exit at the first of: (1) Friday bar closing at/after 16:00 NY (no weekend holds); (2) BarsSinceEntryExecution >= 24;
  (3) Close crosses SMA(5) against the trade (long: Close > SMA5; short: Close < SMA5); (4) emergency stop 3 x ATR(14)
  (ATR taken at the signal bar) measured from the entry fill.
- Signals are evaluated on bar close; market orders fill at the open of the next 1-minute bar.

## Variants (declared up front, the only ones tested)
- A: long + short.
- B: long only.
Variants tried: **2**.

## Costs
Commission $5.76 per round trip, 1 tick ($12.50) slippage on EVERY fill (entry, exit, stop), 1 ES contract, $50/point.
Gross figures use raw prices with no commission and no slippage.

## Periods
- Development: 2020-01-01 .. 2023-12-31
- Validation: 2024-01-01 .. 2025-03-31
- Holdout: 2025-04-01 .. 2026-09-25 (end of data). NOT unopened: the 2025-04..2026-09 data was viewed in Sept 2026
  before this protocol existed (earlier NinjaTrader runs). It is reported, but cannot count as a clean holdout.
  The post says so.

## Data history (stated for honesty)
1. 2026-09-27: rules written; first run on 2025-04..2026-09 (two windows).
2. 2026-09-27: ES 1-minute history back to 2020 downloaded and run (2020 .. 2024-12).
3. 2026-10-07: this protocol run on all periods together with the random-entry control.

## Gates (protocol v1.0, all net of costs)
1. PF >= 1.2 in the validation period.
2. At least 50 trades in each period (below that: "inconclusive" for that period).
3. t-statistic >= 2.0 on the development period.
4. Above the 95th percentile of 500 random-entry runs (same exits, stops, hours, one position at a time, same trade
   count, entries at random eligible bars; long-only for B, random side for A). Measured on average net $/trade over
   the whole sample.
5. Still positive after removing the 10 best trades.
6. Holdout net positive (flagged as used).

A strategy must pass all six gates. Verdict labels: Buried / Inconclusive / Survivor.

## Engine conventions fixed before the run
- Stop fills at the stop price, or at the bar open if the 1-minute bar gaps through it, plus 1 tick adverse slippage.
- A stop can trigger inside the entry minute bar (conservative).
- If a stop-out happens inside an hourly bar, a new entry can be taken on that bar's close if the rules allow.
- BarsSinceEntryExecution at the close of hourly bar k = k - (entry bar index + 1), as in NinjaTrader.
