# Trendline breakout and bounce on YM (Dow futures), 1-hour bars - specification (RIP Backtest protocol v1.0 plus the 8 Oct 2026 rules)

Specification written and **frozen 2026-10-22 (approved by the owner the same day, draft 1 unchanged)**. No hourly bar, swing point, trendline, signal or trade of this test has been computed. Once frozen, any change of a rule is documented and treated as a separate test; bugs may be fixed.

## Why this test, and what was looked at before
- **Chosen by the owner** on 2026-10-22: the YouTube video "How To Trade TRENDLINES In UNDER 17 Minutes" (channel Tori Trades, about 1.9 million views, published about a year earlier; transcript pasted by the owner the same day). The video trades **MYM (micro Dow futures) on 1-hour bars** after a top-down markup from the monthly chart, and promotes a paid community. Its only "real" trade is one example on crude oil (+$27,600, 3.11 R).
- **The trader draws the lines by eye.** We test **the rules she states** (below), made mechanical with choices fixed here before any data is run. A different eye could draw other lines; that part cannot be tested by anyone, and the article will say so.
- **Data:** the owner exported YM (the full-size Dow future; MYM has the same prices at a tenth of the size) from NinjaTrader on 2026-10-22 for this test. **No strategy has been run on YM before.** The same months of the US index market have been used by our ES and NQ tests.
- **Looked at before (disclosed):** many trend and breakout rules on ES and NQ (golden crosses, EMA crosses, Supertrend, Donchian, noise area, Initial Balance, opening ranges, NR7), all buried; the cross-test guides of 22 Oct 2026 (trading costs, cross-market scoreboard, trend vs mean reversion, stop losses), which found that breakout rules beat random entries more often than other kinds, and that stops cut the worst loss but rarely raised the result. **No trendline has been computed on any market on this site.**

## What the video says (the rules to be tested)
- **Upward line:** point A = the lowest point on the chart; point B = "the most recent higher low where price has not yet intersected" the line; drawn as a ray (extended to the right). **Fan:** each new, steeper line uses the previous point B as its new point A and the next most recent low that leaves the line unbroken. **Downward line:** the same on highs (A = the highest point, B = the most recent lower high).
- **Top-down:** marked from the monthly chart down to the 1-hour chart, where all decisions are made.
- **Bounce:** when price comes to a line, trade in the line's direction (a short at a downward line); stop on the other side of the line.
- **Breakout (her favourite):** when price breaks a line, trade in the direction of the break (a short when an upward line breaks); stop on the other side of the opposite (downward) line.
- **Exit, both:** no take-profit; the stop is moved along the line ("trail it into profit"), and the trade is closed when price breaks the line it is following. A take-profit at support or resistance is optional; not tested here.

## Instrument and data
- **YM** (E-mini Dow futures, $5 a point, tick 1 point), `YM_1min.csv` (NinjaTrader, back-adjusted continuous contract, sha256 `e434dac4...`, see `data_manifest.md`), 1-minute bars on the New York clock, cut at **2026-09-25 17:00 New York** like every futures study.
- **1-hour bars** built from the minutes as in our other 1-hour futures tests (`gh_lib.barsOf(M, 60)`: a bar closes on the whole hour, New York clock; empty hours do not exist; the session break and weekends are simply gaps between bars).
- **Holes (rule 3):** `data_holes_ym.json` (27 holes in 20 windows, the largest 2023-04-05 14:03 to 2023-04-16 18:01, also missing in gold). Prices are never filled; a hole behaves like a weekend. Every gate and verdict is recomputed without the trades open across a hole.

## Mechanical readings (fixed now)
- **Swing points:** a swing low is an hourly bar whose low is strictly lower than the lows of the k bars before and the k bars after it; a swing high the same on highs. It becomes known at the close of the k-th bar after it. **k = 5 or 10** (the two variants of swing size).
- **"The chart":** the last **2,000 hourly bars** (about 17 weeks). Reading of the top-down markup: the highest-timeframe lows and highs are also hourly swing points, and the fan always ends on the steepest line near price, so the long window replaces the monthly-to-hourly passes.
- **Upward lines at the close of bar t:** A0 = the lowest swing low known in the window. Given A, the candidates for B are the swing lows known by t, after A, with a higher low; the line through A and B is **unbroken** if no hourly **close** from A to t is below it. B = the most recent unbroken candidate. Then A = B and repeat, until no candidate remains. The **active upward line** is the last (steepest) one. **Downward lines:** the same with swing highs, lower highs, closes above.
- **Line value** at bar j: the straight line through the two points, in bar counts (not clock time), so gaps and weekends do not bend it.
- **Signals at the close of bar t** (using the active lines of bar t-1, so a line is never drawn through the bar that breaks it):
  - **Breakout:** close below the active upward line: a **short**; close above the active downward line: a **long**.
  - **Bounce:** the bar's high reaches the active downward line and the bar closes below it: a **short**; the low reaches the active upward line and the bar closes above it: a **long**.
- **Entry:** at the open of the first minute after the signal bar. No trade if the stop (below) does not exist or the entry is already beyond it. One position at a time; signals while a position is open are ignored.
- **Stop and trail:** the **guiding line** is, for a breakout short, the active downward line (the opposite line, as in the video), for a breakout long the active upward line; for a bounce, the line that was touched. The stop is **one tick beyond the guiding line's value**, recomputed at every hourly close (the line is extended, or replaced by a steeper active line of the same direction when one forms), and **never moved against the trade**. Checked on every minute from the entry minute on; a minute opening beyond the stop fills at its open (weekends, the daily break and holes included). There is no target and no time limit.
- **R** = the distance from the entry to the first stop, in points.

## Variants (the only ones tested)
**TL-BO-5, TL-BO-10** (breakout, swing size 5 or 10) and **TL-BN-5, TL-BN-10** (bounce, swing size 5 or 10). All long and short.

## Costs
- **$15.76 per round trip per contract** (commission $5.76 plus one tick, $5, of slippage on each fill), the rule of all our futures tests (NQ has the same cost). A position held across a quarterly roll pays one more round trip, as in our 1-hour ES tests (YM rolls on the equity-index roll dates used by `gh_lib.js`, `ML.ROLLS`). Results in dollars per contract and in R.

## Periods, gates, control
- **Periods (by entry date), as in the other futures tests:** development 2020 to 2023; validation 2024-01 to 2025-03; holdout 2025-04 to 2026-09-25 (**first use of YM**; the same months were used on ES and NQ, so it is reported as "not opened on this market" rather than as fresh).
- **Six gates per variant** (net dollars per contract): validation profit factor >= 1.2; at least 50 trades in each period; development **t >= 2.5** (four variants; trend and breakout rules have been tried many times on US index futures); above the 95th percentile of 500 runs of the matched control; positive without the 10 best trades; holdout net positive. Fewer than 30 trades in all: Inconclusive.
- **Matched control (moved entries):** every real entry moved, all together, by one random circular offset of whole trading days (at least 5% of them), to the same hour of the new day, same direction; the same stop-and-trail rule with the lines active at the new time (a moved entry with no guiding line is skipped, and the count is reported); same costs. 500 runs, seeds 1000 + run. Statistic: average net dollars per trade. It asks whether the break or the touch of a line beats entering at random times with the same exits.
- **Also reported (descriptive):** how many lines were active and how long they lasted, how many signals each kind gave, long and short, by year, holding time, exits by reason, the R distribution.

## Engine and self-test (before the run)
New engine `tl_lib.js`, independent re-implementation `tl_ref.js`, `tl_selftest.js` that must pass before any result is printed: swing points and their confirmation delay; the fan on a hand-made series (A0, the most recent unbroken B, the steeper next line, a candidate refused because a close broke it); line values across a weekend gap (bar counts); a breakout, a bounce, a touch without a close back (no bounce); the stop trailing along a line and never loosening, a gap through the stop, a hole; the reference matched trade by trade on the real data for all four variants; the control at offset 0 reproducing the real trades.

## Before the article
Results go to the owner first. One article, published only with the owner's agreement. Working title for search: "Trendline Trading Strategy Backtest: Do Trendline Breakouts Work? (Dow Futures)".

## Reading the result
"Buried" or "Inconclusive" mean a statistically convincing edge was not demonstrated; neither is proof that none exists. One market, one data source, one mechanical reading of rules that their author applies by eye.
