# Supertrend (default settings) - frozen specification (RIP Backtest protocol v1.0)

Specification written **2026-10-07, before `st_protocol.js` was run on any data.**

## The claim being tested
Supertrend is a trend-following indicator (widely credited to Olivier Seban; sources differ on its exact origin) that plots a line below price in an uptrend
and above price in a downtrend, built from ATR. The popular claim: be long while it is green, short while it is red.
We use the common default settings, **ATR period 10, multiplier 3**, and do not tune anything.

## Indicator (standard definition)
- ATR = Wilder (RMA) average of true range, period 10, on the bars of the chosen timeframe.
- Basic bands: hl2 +/- 3 x ATR, hl2 = (high + low) / 2.
- Final upper band = basic upper if basic upper < previous final upper OR previous close > previous final upper; else previous final upper.
  Final lower band is the mirror image.
- Direction: when the previous line was the upper band, direction is UP if close > final upper, else DOWN. When the previous
  line was the lower band, direction is DOWN if close < final lower, else UP.
- Signals are evaluated on **bar close** only. Market orders fill at the open of the next 1-minute bar.

## Trading rule
Target position is a function of the Supertrend direction at each eligible bar close: UP -> long, DOWN -> short (long/short
variants) or flat (long-only variant). Reversals are stop-and-reverse (exit and enter at the same fill time). There is no
separate stop beyond the Supertrend line itself, and no profit target. 1 ES contract.

## Variants (declared up front; the ONLY ones tested)
| Id | Bars | Sides | Session rule |
|---|---|---|---|
| ST60-LS | 60-minute | long + short | trades around the clock, flat before the weekend (Friday bar closing at/after 16:00 NY exits; no entries then) |
| ST60-L | 60-minute | long only | same as above |
| ST15-LS | 15-minute | long + short | regular trading hours only: entries/reversals on bar closes 09:45..15:45 NY, flat at the 16:00 NY bar close |
| ST5-LS | 5-minute | long + short | regular trading hours only: entries/reversals on bar closes 09:35..15:55 NY, flat at the 16:00 NY bar close |

Variants tried: **4**. Passing a gate by luck becomes more likely as variants are added, so the post states the count.

## Costs
$5.76 commission per round trip, 1 tick ($12.50) slippage on EVERY fill (entry and exit), $50/point. A reversal is two
fills (one exit, one entry). Gross figures use raw prices without commission and slippage.

## 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: 2025-04..2026-09 ES data was used in earlier tests of other strategies (Sept 2026). It is
  reported, flagged as used. No Supertrend result was seen before this specification was written.

## Gates (protocol v1.0, net of costs, evaluated per variant)
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-process runs (see below). Measured on average net $/trade over the full sample.
5. Still positive after removing the 10 best trades.
6. Holdout net positive (flagged used).

## Random-entry control (same exits, session rule and trade count)
- Long/short variants: a random stop-and-reverse process. At each eligible bar close the position reverses with a
  probability p (calibrated so the trade count matches the real strategy); after a flat period it re-enters on a random side.
- Long-only variant: random entry with probability p_in per eligible bar when flat; exit with probability p_out per bar when
  long, with p_out = 1 / (average bars held by the real strategy); p_in calibrated for the trade count.
- 500 runs, fixed seeds. Same costs and session rules as the real strategy.

## Engine conventions (fixed before the run)
- Indicators are computed continuously on the full bar series (no restart per period).
- Entry fill = open of the 1-minute bar after the signal bar, plus/minus 1 tick; exit likewise.
- Positions are marked trade-by-trade by entry date for period assignment.
