# Ichimoku Cloud strategies on EUR/USD (1-hour, 4-hour and daily bars) - specification (RIP Backtest protocol v1.0 plus the 8 Oct 2026 rules)

Specification written and **frozen 2026-10-14 (approved by the owner the same day, draft 1 unchanged)**, before any Ichimoku line, signal or trade was 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-14 after a search-demand check: Ichimoku was among the indicator strategies compared on Google Trends, and Google's suggestions name forex first ("ichimoku strategy forex", "ichimoku cloud forex strategy"), then crypto, and ask for its "success rate". Market and timeframes chosen by the owner the same day: **EUR/USD; 1-hour, 4-hour and daily bars** (Ichimoku was designed for daily charts; 1-hour and 4-hour are the usual forex timeframes).
- Earlier tests on this EUR/USD file: the FX study, the 1-hour golden cross, the Fibonacci 61.8% pullback, the Turtle rules and the Stochastic + RSI + MACD strategy. No Ichimoku line was looked at.

## Instrument and data
- **EUR/USD** spot, the 1-minute bid history of the IC Markets MetaTrader 4 demo server, 2004-01-01 to 2026-09-28 15:46 New York (`fb_clock.loadEur({ fix: false })`, as in the other EUR/USD tests).
- **Bars** on the New York clock, cut at the forex day's 17:00 New York boundary: 1-hour bars, 4-hour bars (17:00, 21:00, 01:00, ...) and daily bars (17:00 to 17:00, Sunday evening belonging to Monday), built from the minutes that exist; daily bars with fewer than 30 minutes are dropped.
- **Clock:** the labels are an hour early in many weeks of 2004-2014 (clock audit); on 4-hour and daily bars this moves one hour across a boundary in those weeks. As in the Turtle EUR/USD test, the run is repeated on the corrected copy of the file (`clock_audit_fix.js`); gates and verdicts must match, or the difference is reported.
- **Holes (rule 3):** `data_holes_eur.json`; trades open across a suspect or unclear gap are counted, and every gate and verdict is recomputed without them.

## Ichimoku (standard settings 9, 26, 52)
- **Tenkan-sen** = (highest high + lowest low of the last 9 bars) / 2; **Kijun-sen** = the same over 26 bars.
- **Senkou Span A** = (Tenkan + Kijun) / 2 and **Senkou Span B** = (highest high + lowest low of the last 52 bars) / 2, both plotted 26 bars ahead: the **cloud** at bar k is formed by the two spans computed at bar k - 26. Cloud top = the higher of the two, bottom = the lower.
- **Chikou Span** = the close plotted 26 bars back; it confirms a long when the close of bar k is above the close of bar k - 26 (a short when below).

## The two strategies (long and short)
- **TK cross (IC-TK):** a **long signal** at the close of bar k when the Tenkan crosses above the Kijun (Tenkan[k] > Kijun[k] and Tenkan[k-1] <= Kijun[k-1]) **and the close is above the cloud**. **Short:** the Tenkan crosses below the Kijun with the close below the cloud.
- **Kumo breakout (IC-KUMO):** a **long signal** when the close moves above the cloud (close[k] > top[k] and close[k-1] <= top[k-1]) **and the Chikou confirms** (close[k] > close[k-26]). **Short:** the close moves below the cloud with close[k] < close[k-26].
- **Exit (both, the usual Ichimoku trailing exit):** a long is closed after the first bar that closes **below the Kijun-sen**, a short after the first bar that closes above it. No target, no other stop.
- **Execution:** entries and exits at the open of the first 1-minute bar after the signal or exit bar. One position at a time; a signal while a position is open is ignored, and a new signal can come from the bar after the exit bar. A position open at the end of the data is closed at the last close and flagged.
- **Six variants:** **IC-TK-H1, IC-TK-H4, IC-TK-D1, IC-KUMO-H1, IC-KUMO-H4, IC-KUMO-D1**, all long and short.

## Costs and results
- **About 1 pip per round trip** (0.15 pip on every fill plus 0.7 pip commission), as in every EUR/USD test on the site. **Results in pips** per trade (there is no fixed stop to measure R against).
- **Financing scenarios** (the verdict uses the baseline): A, 2% a year of the entry price per calendar day held; B, today's IC Markets EUR/USD swap (long -7.99, short +1.31 points per lot per night, Wednesday counting three, rollover at 17:00 New York): not a historical rate. Daily trades can last weeks, so the scenarios are reported for every variant.

## Periods, gates, control
- **Periods (by entry date):** development 2004 .. 2012; validation 2013 .. 2019; holdout 2020 .. 2026-09-28 (**already used** by the earlier EUR/USD tests).
- **Six gates per variant:** validation profit factor >= 1.2; at least 50 trades in each period; development **t >= 2.5** (six variants); 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 (moved entries):** every real entry moved, all together, by one random circular offset of at least 5% of the days, to the same time of day on the new day, same direction, then managed by the same Kijun exit and costs, one position at a time. 500 runs, seeds 1000 + run. Statistic: the average net pips per trade.

## Engine and self-test (before the run)
A new engine (`ic_lib.js`) and a self-test that must pass before any result is printed:
1. Hand-worked cases: Tenkan, Kijun, both spans and the 26-bar shift of the cloud; the Chikou check; a TK cross above and below the cloud; a Kumo breakout with and without Chikou confirmation; the Kijun exit; one position at a time; 4-hour and daily bars cut at 17:00 New York; costs, pips and both financing scenarios.
2. Bars and Ichimoku lines against a naive recomputation on the real data.
3. An **independent re-implementation** matched trade by trade for all six variants on the real data.
4. The control at offset 0 reproduces the real trades.

## Before the article
Results go to the owner first: all six variants, every gate, win rates (the "success rate" people search for), long and short separately, by year, holding time, the cost per trade, the financing scenarios, the clock check, the hole check. One article (EUR/USD, three timeframes), published only with the owner's agreement.

## Reading the result
"Buried" or "Inconclusive" mean a statistically convincing edge was not demonstrated; neither is proof that none exists. One market, the standard settings, two common Ichimoku entries and the usual Kijun exit.
