# TDI (Traders Dynamic Index) strategy on EURUSD, 4-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 TDI value, 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: a PDF compilation of "Big E"'s Forex Factory posts ("Craig Harris Stochastics Method by Big E", thread 211188), which the owner summed up as "about the TDI in general". The posts teach entries and exits from Dean Malone's **Traders Dynamic Index** (CompassFX's free Synergy template), with Heikin Ashi candles, a 5-period EMA and stochastics as secondary checks.
- **What we test:** the TDI rules the posts state mechanically, in three readings fixed now (below). The parts the author calls experience ("look left for support and resistance", "avoid consolidation", "don't trade the news", "judgement") cannot be coded and are left out; the article says so. The posts' results ("80% chance", "$9,340", "I can't find one example of the stop being hit") are the author's chosen examples and are not used.
- **Market and timeframe (our choice, stated):** EURUSD, which is on the author's list of eight pairs and for which we have 22 years of data, on **4-hour bars**, the timeframe the author says he trades most ("I trade the 4hr charts").
- **Looked at before (disclosed):** the TDI was part of three earlier, unpublished pieces of work for the owner: a NinjaTrader 1-minute ETH system (EMA 9/20 + TDI, September 2026), the Forex Factory weekly Fibonacci pivots + TDI test on gold and four FX majors at 1 minute (7 October 2026, no edge; it also used the 2020-2026 FX data), and a gold H1 pattern indicator with the Synergy TDI as entry filter (dropped). On these EURUSD bars the site has published the FX six-strategy study, the golden cross, Fibonacci 61.8%, Ichimoku, Stochastic + RSI + MACD, ADX + DI and the Parabolic SAR, all buried. No TDI strategy has been published on the site.

## Instrument and data
- **EURUSD**, IC Markets MT4 demo, 1-minute bid history **2004-01-01 to 2026-09-28** (`fx_data.loadFx`), New York wall clock, close stamps.
- **4-hour bars on the broker's clock:** the MT4 server runs at New York + 7 hours, so its 4-hour candles start at 17:00, 21:00, 01:00, 05:00, 09:00 and 13:00 New York (the author's "my 4hr charts update at 2, 6 & 10" Pacific). Built from the minutes that exist; incomplete bars kept, empty ones do not exist.
- **Holes (rule 3):** `data_holes_eurusd.json`; every gate and verdict is recomputed without trades open across a suspect or unclear gap.

## The indicator (Dean Malone's TDI, the default inputs of the CompassFX version)
- **RSI(13)** of the closes (Wilder's smoothing). **Green (RSI price line)** = SMA(2) of RSI. **Red (trade signal line)** = SMA(7) of RSI. **Yellow (market base line)** = SMA(34) of RSI; volatility bands = yellow +/- 1.6185 x the standard deviation of the last 34 RSI values (population). Levels 32, 50, 68.
- Computed on ordinary candles (the indicator reads the bar closes; Heikin Ashi candles only change what is drawn on the price chart). No signal in the first 500 bars.

## Rules (signals at the close of a 4-hour bar, executed at the open of the first minute of the next bar)
- A **cross up** at bar k: green[k-1] <= red[k-1] and green[k] > red[k] (the author: "make sure green has crossed the red", not touching); a cross down is the mirror.
- **TDI-X (green/red cross, always in):** long at a cross up, short at a cross down, each cross reversing the position (the author's Daily-chart rule: "enter when green crosses red and exit when green crosses red").
- **TDI-50 (Dean Malone's conservative entry):** long when green is above red, above yellow and above 50 at a bar close after not having all three on the previous bar; short when below all three; the position closes at the next opposite green/red cross; flat otherwise.
- **TDI-HOOK (the author's aggressive style and his "homework" rules):** enter at a green/red cross as TDI-X; exit at the first **hook** (green lower than on the previous bar for a long, higher for a short) or at an opposite cross, whichever comes first; then wait for the next cross. This is our fixed reading of "exit when green goes flat, hooks over or reverses".
- No stop or target (the author: "I don't often use a S/L" on 1-hour and 4-hour charts); the worst open loss of every trade is reported. A position open at the end of the data closes at the last close.

## Costs and financing
- **1.0 pip per round trip**, as in every EURUSD test (a reversal pays two half-costs); results at 1.5 and 2.5 times the cost are shown; the verdict is that of the base cost.
- **Swap:** not in the base result; a stress scenario charges 0.5 pip per night held (Wednesday counting three).

## Results, periods, gates, control
- **Unit:** pips per trade (net). Also reported: trades, holding time, long and short, by year, time in the market, the worst open loss.
- **Periods (by entry date):** development 2004 .. 2012; validation 2013 .. 2019; holdout 2020 .. 2026-09-28 (**already used**).
- **Six gates per variant:** validation profit factor >= 1.2; at least 50 trades in each period; development **t >= 2.5** (the stricter FX bar: many strategies have been tried on this pair, and the TDI itself was looked at before); above the 95th percentile of 500 runs of the matched control; positive without the 10 best trades; holdout net positive (flagged used). Fewer than 30 trades: Inconclusive.
- **Matched control (shifted holdings):** every real trade moved, all together, by one random circular offset of whole 4-hour bars (at least 5% of them), keeping its direction and its length in bars; entry and exit at the open of the first minute of the moved bars; same costs. 500 runs, seeds 1000 + run. Statistic: average net pips per trade.

## Engine and self-test (before the run)
New engine `tdi_lib.js`, independent re-implementation `tdi_ref.js`, `tdi_selftest.js` that must pass before any result is printed: the 4-hour bars on the broker's clock; RSI, the three lines and the bands against a hand calculation; crosses including a touch that is not a cross; the TDI-50 entry; the hook exit; reversals; the end of the data; the reference matched trade by trade on the real data for all three 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: "TDI Indicator Strategy Backtest: 22 Years of EUR/USD (Traders Dynamic Index)".

## Reading the result
"Buried" or "Inconclusive" mean a statistically convincing edge was not demonstrated; neither is proof that none exists. One pair, one timeframe, one broker's demo history, three mechanical readings of rules whose author says they need judgement.
