# Donchian Channel breakout, simple and with a profit target and stop - frozen specification (RIP Backtest protocol v1.0)

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

## The claim being tested
A classic trend-following idea: when price breaks above the highest high of the last N bars it has started a new uptrend (and the mirror image for a downtrend),
so trade in the direction of the breakout. Donchian channels are named after Richard Donchian, and a version of this rule became widely known through the "Turtle"
trading experiment of the 1980s. We found no single source for this exact rule set, so we describe it as a common setup and test our own exact definition at
the common defaults (a 20-bar entry channel and a 10-bar exit channel), with nothing tuned.

## 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. (Daily bars would give only about 1,700 bars and too few trades, so we use hourly bars.)

## Signals (evaluated on bar close; market orders fill at the open of the next 1-minute bar)
- Long when the bar closes above the highest high of the previous 20 bars. Short when it closes below the lowest low of the previous 20 bars.
- One position at a time, 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 when a bar closes beyond the opposite 10-bar channel: a long exits on a close below the lowest low of the previous 10 bars, a short on a close
  above the highest high of the previous 10 bars. No stop, no target. Weekend flat.
- **Full version (F):** stop = 2 x ATR(14) (at the signal bar) from the entry fill, target = 4 x ATR(14), time limit 48 bars. Weekend flat. No channel exit.
  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)
DC-LS-S (long + short, simple), DC-L-S (long only, simple), DC-LS-F (long + short, full), DC-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, a random side (long only for the long-only variants), and the trade count calibrated
to match the real variant. 500 runs, fixed seeds. The statistic is the average net $ per trade over the full sample.

## Engine conventions (fixed before the run)
Identical to 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 open if gapped;
costs apply to every fill; indicators are computed continuously on the full series. The engine reproduces the published RSI(2) Dip Buyer trades exactly.
