# Bollinger Band reversal ("rubber band"), simple and with a profit target and stop - frozen specification (RIP Backtest protocol v1.0)

Specification written **2026-10-07, before `bb_protocol.js` was run on any data.** Bugs may be fixed after the run; rules may not.

## The claim being tested
A common mean-reversion idea sometimes called the "rubber band" setup: when price closes outside a Bollinger Band it has stretched too far
from its average and tends to snap back toward the middle. Bollinger Bands were created by John Bollinger. We found no single source for this
exact rule set, so we describe it as a common setup and test our own exact definition. (Not to be confused with our RSI(2) test, which uses
a different indicator.)

## Instrument and data
ES futures, 60-minute bars built from our 1-minute data (bar time = close time, New York clock), 2020-01-01 to 2026-09-25. Costs: $5.76
commission per round trip and 1 tick ($12.50) slippage on every fill, 1 contract, $50/point.

## Indicator
Bollinger Bands on hourly closes: middle = SMA(20), bands = middle +/- 2 x standard deviation (population, 20 bars). ATR(14) Wilder.

## Signals (evaluated on bar close; market orders fill at the open of the next 1-minute bar)
- Long when the bar closes below the lower band. Short when it closes above the upper band.
- One position at a time. Trades around the clock, flat before the weekend (a Friday bar closing at or after 16:00 New York time exits, and no entries then).

## Exits
- **Simple version (S):** exit at the first bar close back across the middle band (long: close above it; short: close below it), or at the weekend flat. No stop, no target.
- **Full version (F):** profit target = the middle band value at the signal bar, as a fixed price. Stop = 2 x ATR(14) (at the signal bar) from the entry fill. Time limit 24 bars. Weekend flat.
  If target and stop could both have been touched inside the same 1-minute bar, the stop is assumed to hit first.

## Variants (declared up front; the ONLY ones tested)
BB-LS-S (long + short, simple), BB-L-S (long only, simple), BB-LS-F (long + short, full), BB-L-F (long only, full).
Variants tried: **4**.

## Periods
Development 2020-01-01 .. 2023-12-31; Validation 2024-01-01 .. 2025-03-31; Holdout 2025-04-01 .. 2026-09-25.
The holdout is NOT unopened: this ES data was used in earlier tests of other strategies. It is reported, flagged as used.

## Gates (protocol v1.0, net of costs, per variant)
1. PF >= 1.2 in the validation period. 2. At least 50 trades in each period. 3. Development t-statistic >= 2.0 (four variants tried, so the base bar applies).
4. Above the 95th percentile of 500 random-entry runs. 5. Positive after removing the 10 best trades. 6. Holdout net positive (flagged used).

## Random-entry control
Same exits, session rule and costs, entries at random bars when flat. The direction is the one that mean reversion would take at that bar
(long if the close is below the middle band, short if above), so the exit rules always make sense, and the trade count is calibrated to match the real
variant. This tests whether the 2-standard-deviation extreme matters, or whether any bar on the "right side of the mean" does as well. 500 runs, fixed seeds.
The statistic is the average net $ per trade over the full sample.

## Engine conventions (fixed before the run)
Costs and fills as in our other ES tests. A target fills at its price, or at the bar's open if a 1-minute bar gaps through it. A stop fills at its price, or at the
bar's open if gapped. Both costs (commission and 1 tick) apply to every fill, including targets. Indicators are computed continuously on the full series.
The simulation engine was checked first: configured as the original RSI(2) Dip Buyer it reproduces the published trades and net result exactly.
