# EURUSD three-down reversal — one observed-session hold

One hypothetical EUR 10,000 long-only EURUSD CFD case, evaluated 2016–2025,
with a matched long buy-and-hold benchmark. The idea comes from the public
section 34 and FAQ summary of [Quantified Strategies' SPY article](https://quantifiedstrategies.substack.com/p/spy-trading-strategies),
dated 23 November 2026. Paid settings were not read or reconstructed. EURUSD,
UTC BID bars and next-quote execution are a transfer test, not a replication
of SPY performance. Both five-year diagnostic splits precede source publication
and are entirely retrospective.

## Frozen protocol

`protocol.json` was saved at `2026-11-27T09:03:21.622348+00:00`, before signal
counts or returns. SHA-256:

`b1f5db84073f0fd101ecba9400d0bbecca188db1e23f4de8a960afa8e99b74da`

1. Aggregate actual M5 quotes into observed UTC Monday–Friday **BID daily
   closes**. Exclude Sunday daily signals; do not fabricate missing dates.
   Observed partial weekdays and zero-range bars remain valid observations.
2. Enter on four successive observed weekday closes satisfying
   `C[d] < C[d-1] < C[d-2] < C[d-3]`: three strict drops, not three closes.
   Each adjacent price difference must exceed
   `1e-12 * max(1, abs(adjacent prices))`. Equality breaks the streak; this guard
   is far below one quote point. Dates need not be consecutive calendar days.
3. A completed day becomes available at following 00:00 UTC. Consume each event
   once at the first observed M5 **OPEN** at or after availability. Execution-bar
   high, low and close never select the order. Pending actions do not expire
   after 15 minutes; only conversion quote freshness is bounded.
4. **Exit first** when the next observed completed weekday event has a source
   date later than the held position's **entry signal date**. This is streamed
   completion, not a future calendar lookup or a fixed 24-hour timer. Exit does
   not depend on the new day's pattern or entry context readiness.
5. Then, if that same event satisfies three-down and the account is flat, enter
   again at that quote. A fourth consecutive decline can therefore close and
   reopen, paying new spread, slippage and commissions. One position; no stop,
   profit target or other filter.
6. Start 2016 flat. Use 2015 closes as context but retain only the latest observed
   2015 weekday event once, not every old signal and not an old position. Any
   remaining position is forcibly closed at the last available 2025 close with
   costs and a distinct reason.

Weekend execution follows these definitions. For example, a Thursday signal
can enter Friday, with the completed Friday event unavailable until Saturday
00:00 and executable at Sunday reopening. Actual elapsed holding time can exceed
24 hours. Missing weekday prices do not create a synthetic exit session.

## EUR accounting and costs

Buy at historical ask plus adverse **0.1 pip**, sell at bid minus 0.1 pip.
Commission is USD 3.50 per 100,000 EUR lot per side. Minimum and step are 0.01
lot, floored down, with at most current EUR cash in entry notional and entry
commission reserved:

`lots = floor(cashEUR / (100000 * actualEntryPrice / EURUSDask + 3.5 / EURUSDbid) / .01) * .01`

Actual entry price includes slippage. Positive USD P&L converts at EURUSD ask;
negative P&L, fees and funding at bid. Long floating P&L marks BID. EURUSD itself
provides synchronized conversion quotes. Entry quote age must be at most 900
seconds or that event is consumed/skipped without a later fresh retry. Stale
exit/valuation conversion quotes are retained and flagged.

**Funding is an assumed 5% annual debit on absolute entry USD notional**, accrued
over actual calendar seconds/365, not observed historical swap or carry. It
starts at actual entry and stops at exit. At a same-quote roll, old funding and
exit fees finish before the new entry and its fees/funding begin. Cash earns
zero. This is CFD cash/P&L accounting, not a currency-deposit total return.

Buy-and-hold fixes initial quantity from the first 2016 quote to the final 2025
close with the same entry cap/costs. Its holding duration differs. A separately
nested **ex-post exposure-scaled passive diagnostic** linearly scales passive
P&L and costs around EUR 10,000 by active/passive time-average absolute EUR
notional. Cash earns zero. This fractional synthetic allocation is not
lot-deployable or another strategy case. Exposure integrates previous observed
marks across elapsed intervals, including gaps.

## Reproduce

Use Python 3.12 and exact package versions in `requirements.txt`:

```sh
python download_data.py --symbols EURUSD --period M5 --start-year 2015 --end-year 2025 --directory data --workers 3
python verify_data.py --require-raw
python -m unittest test_backtest -v
python backtest.py --data-dir data --out results
```

Preserve [EV Trading Labs](https://evtradelabs.com/data) attribution. Prices are
Dukascopy-derived distributor aggregates, not independently reconciled direct
bank tick exports or actual FTMO broker quotes. Input manifests retain annual
and processed hashes. Full M5 prices and annual raw caches are excluded from
public downloads; scripts recreate them subject to provider access. Local cache
reuse is not a new download. See `data/README.md` and `data_quality.json`.

## Outputs and verification

`daily_bid_three_down.csv` contains observed daily OHLC, prior three observed
closes/dates, readiness, pattern and availability. `strategy_daily_events.csv`
records every completed event, entry/exit actions, same-quote rolls, delays,
ignored signals and skip reasons. Trades preserve both entry signal day and
exit source day, all prior prices/dates, actual fills, conversion quotes,
fees/funding and holding time.

Summary JSON/CSV, both daily equity curves, all trade/event logs, the exposure
comparison and four PNG charts are included. Local runs write both sampled M5
account curves. The public package includes the strategy M5 curve; the large
passive M5 curve is omitted for size and regenerated by `backtest.py`.

All closed-trade statistics are net of every modeled cost. Sharpe uses calendar
daily returns, sqrt365 and zero risk-free rate. A one-trade passive PF is not a
robust distribution metric. Daily bar-end valuations belong to the interval
just completed (`bar_end - 1 nanosecond`), so a final bar ending at 2026-01-01
stays in 2025-12-31 daily equity. Sampled M5 drawdown omits the intrabar tick path.
The fixed 2016–2020 / 2021–2025 splits are retrospective diagnostics, not pristine
prospective out-of-sample evidence. Cross-boundary trades stay in equity but are
excluded from split trade PF/win-rate calculations.

FTMO screens record continuous-account loss flags, maximum flat balance, first
flat 10% target and as-of-target best-day/total **NET closed profit including
losing days**. A flat realization between exit and immediate re-entry is
recorded before the new entry fees. The separate continuous 5% threshold is not
a fresh verification phase. Missing-midnight gaps require a first-quote Prague
balance approximation. Actual broker swaps, tick equity, all phase/restart
conditions and compliance are not certified. An ending loss does not prove that
no earlier target occurred.

`run_environment.json` records the actual run interval, versions and hashes.
Synthetic tests cover four-close readiness, equality, missing dates/Sundays,
initial seeding, streamed exits, weekend holds, immediate re-entry, causality,
rolling fees/funding, exposure and target records. `INDEPENDENT_QA.md` documents
separate raw-data checks when completed. Python execution is not MT5 compilation
or terminal validation; see the EA notes. Original software is MIT licensed;
sources, market data and dependencies retain their own terms.
