# ETF baseline experiment v1

New educational implementation and run dated 2026-10-19. Compares buy and hold with monthly 12-month momentum for SPY/IEF/GLD from 2007-01-03 through 2025-12-31 using currently supplied historical adjusted prices. This is not point-in-time data reconstruction, live trading, or an AI/ML comparison.

Python >=3.9, standard library only. Extract the ZIP into a fresh directory and run inside it:

```sh
python3 -m unittest -v
python3 backtest.py --download --data market-inputs --out my-results
python3 verify.py --data market-inputs --results my-results
```

The data and output directories must not already exist. Downloading needs network access and Yahoo availability. If a download fails, retry with a new directory, not partial inputs. Raw vendor prices are not bundled. Revisions or access restrictions can change inputs or prevent downloading.

The published report in reference-results/results.json records normalized-price and raw JSON SHA-256 values. Raw JSON hashes can change with metadata alone. verify.py recomputes and compares all 17 output files and four independent buy-and-hold formulas, then separately reports whether the normalized input matches the published run. Different data are a new calculation, not exact reproduction. Byte comparisons may also fail across Python versions due to floating-point representation.

Momentum equally weights assets with a strictly positive 12-month month-end adjusted-price change, or holds cash if none qualify. Execution is at the next observed session's close. Cash interest is zero; costs apply to traded value at 0/5/10/20bp each way, including entry and final liquidation. Post-fee target sizing and drifting holdings are used. Adjusted-price units approximate reinvested distributions, not literal shares; dividends are not added again. Taxes, FX, market impact, and extra spread are excluded.

Executed on macOS / Python 3.14.5: nine unit tests, four real-data closed-form buy-and-hold comparisons, and invariance of earlier signals after removing future rows. This does not establish independent-machine reproduction, vendor accuracy, or future returns. Exact source snapshots are retained only in the operator's private backup.

Source endpoint: https://query1.finance.yahoo.com/v8/finance/chart/SPY (same format for IEF/GLD)
Price explanation: https://help.yahoo.com/kb/SLN28256.html
Article: https://forge-fate.com/en/posts/part-6-the-first-baseline-building-a-simple-momentum-strategy
