# EURUSD during US stock-options expiration weeks

One EUR 10,000 long-only EURUSD CFD calendar transfer test, all months of
2016–2025, with a matched long buy-and-hold benchmark. Sources are the public
[21 June 2024 note](https://quantifiedstrategies.substack.com/p/the-options-expiration-week-effect-2a7)
and [20 March 2026 note](https://quantifiedstrategies.substack.com/p/the-options-expiration-week-effect-aa2).
This applies a **US stock-options calendar to FX**. It is not a test of EURUSD
option expirations or replication of SPY returns. No favorable-month filter or
alternative rule was selected using performance.

## Frozen calendar protocol

`protocol.json` was frozen before counts or outcomes at
`2026-11-30T09:09:34.501835+00:00`. SHA-256:

`41c7bb4a8f3c7baade07c0d360bada38c8299b959f05cec7362c708c6a0010b6`

1. For every month, find the **literal third Friday**, whose day is 15–21.
   This resolves the source's inconsistent third-Saturday parenthetical
   explicitly; Saturday is not the anchor. Week Monday is that Friday minus
   four calendar days.
2. Select the first actual XNYS session whose date lies inside Monday through
   that Friday, inclusive. Enter at its known **09:30 New York opening**.
   If Monday is a market holiday, the first session can be Tuesday.
3. Select the last actual XNYS session inside the same date window. Exit at
   its known **actual calendar close**. If Friday is a holiday, that can be
   Thursday. Neither choice consults future prices or exit quote availability.
4. Entry requires an **exact M5 opening timestamp** at the selected calendar
   open. A missing quote consumes/skips the month; no later fill rescues it.
   Entry conversion quote age must be at most 900 seconds or that month is
   skipped without a later fresh retry. Current execution-bar high/low/close
   selects no order.
5. Exit at the first observed M5 **OPEN** at or after the selected close.
   Retain pending exits through missing quotes; never invent a closing fill.
   A pending exit executes before a new month's entry. One long position,
   no stop, profit target or other filter. Remaining positions are forcibly
   closed at the last available 2025 close with costs and an explicit reason.

Start 2016 flat. No indicator warmup or 2015 position is required. The broader
frozen cache may contain 2015; the loader uses only 2016–2025 price rows.
Every calendar month is included.

The required bundled [sessions.csv](sessions.csv) has SHA-256
`3cbbac4e5d20f5f2471fb476521a6106b6a6b3959e808dc380d86e3c4f10558d`.
Its manifest records exchange_calendars 4.13.3 and holiday/DST anchors. Known
NYSE session dates and America/New_York timestamps are exogenous. The CSV,
manifest, generator and pinned calendar requirements are included; using the
frozen CSV needs no calendar-library installation. The same CSV is an EA
`MQL5/Files`/tester dependency; see `MQL5_NOTES.md`.

## EUR account and costs

Buys use historical ask plus adverse 0.1 pip; sells use 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. Entry notional is capped at current EUR cash, reserving
entry commission:

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

Actual entry includes slippage. Positive USD P&L converts at EURUSD ask;
negative P&L, fees and funding at bid. Long floating P&L marks BID. Exit and
valuation conversion staleness are retained and flagged. EURUSD itself provides
synchronized conversion quotes in this dataset.

**Funding is an assumed 5% annual debit** on absolute entry USD notional over
actual elapsed calendar seconds/365. It is not observed historical broker swap
or carry. Cash interest is zero. This is CFD cash/P&L accounting, not a currency
deposit total return.

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

## Reproduce

Use Python 3.12 and exact 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 --calendar sessions.csv --out results
```

The download reproduces the frozen broader cache for manifest matching; its
2015 rows are not warmup or trading inputs. Preserve
[EV Trading Labs](https://evtradelabs.com/data) attribution. Prices are
Dukascopy-derived distributor aggregates, not independently reconciled bank
tick exports or actual FTMO broker quotes. Annual and processed input hashes
are retained. Full raw prices/annual caches are excluded from public downloads;
scripts recreate them subject to provider access. Cache reuse is not a new
download. See `data/README.md` and `data_quality.json`.

## Outputs and interpretation

`monthly_signals.csv` records every month, literal third Friday, Monday date,
first/last actual sessions, holiday shifts and known entry/exit timestamps.
`session_events.csv` adds actual entry/exit and skipped-month reasons. Trade
logs retain month anchors, session dates, actual bid/ask/fills, conversion
quotes, fees, funding and known exit deadline.

Both daily equity curves, all trade/event logs, the exposure comparison, summary
JSON/CSV 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`.
`run_environment.json` records the actual run interval, versions and hashes.

All closed-trade statistics include modeled costs. Daily Sharpe uses calendar
returns, sqrt365 and zero risk-free rate. Single-trade passive PF is not a robust
distribution metric. Daily bar-end values belong to the just-completed interval
using a one-nanosecond boundary shift, retaining a final close at 2026-01-01 in
2025-12-31 daily equity. Sampled M5 drawdown omits the tick path. Fixed 2016–2020
and 2021–2025 splits are retrospective diagnostics, not pristine prospective
out-of-sample evidence. No monthly outcomes were used to retain/exclude months.

FTMO outputs are continuous-account necessary conditions, not certified passes:
first sampled loss flags, maximum flat balance, first flat 10% target and
as-of-target best-day share of **total NET closed profit including losing days**.
A separate continuous 5% threshold is not fresh Verification. Missing-midnight
quotes require a first-quote Prague balance approximation. Actual swaps,
tick equity and all phase/restart/compliance conditions are not replayed.
An ending loss alone does not prove that no prior target occurred.

Synthetic tests cover Saturday-start months, literal Friday, holiday Monday
and Friday shifts, DST, exact entry, retained missing exits, calendar-only
causality and EUR cost/funding reconciliation. `INDEPENDENT_QA.md` records the
separate raw-data audit when complete. MQL5 is source only; no terminal
compilation or native MT5 validation is implied. Original software is MIT
licensed; sources, data and dependencies retain their own terms.
