Forge Fate
Quant & Data Research

A 12-Month Momentum Backtest with SPY, IEF, and GLD: Comparing Baselines from 2007 to 2025

9 min read

Execution record: 2026-10-19

This educational backtest compares buy-and-hold with 12-month momentum using historical adjusted closing prices for SPY, IEF, and GLD. It records a calculation implemented and run on that date; it does not recast experiments planned in earlier articles as work already performed then. It does not validate live trading or AI model performance.

“Would holding only ETFs with positive 12-month returns beat buying them at the start and continuing to hold them?”

I calculated this comparison using historical data for SPY, IEF, and GLD. The evaluation period runs from 2007 through 2025, starting with $10,000.

With one-way transaction costs of 10 basis points, the results were as follows. Ten basis points means 0.1% of traded value, applied separately to purchases and sales.

StrategyEnding valueAnnualized returnMaximum drawdown
Buy-and-hold$50,228.048.87%-20.75%
12-month momentum$46,361.298.41%-24.16%

Under these conditions, momentum was less favorable than buy-and-hold on both return and maximum drawdown. Its return was also lower with transaction costs set to zero.

This article describes the conditions behind those results, the accounting in the transaction ledger, and what the public materials can verify. It does not claim that other periods and assets would produce the same outcome.

1. Conditions used to compare the two strategies

ItemFixed condition
AssetsSPY, IEF, and GLD, in USD
Input dataYahoo Finance daily adjclose, 2005-01-03 through 2025-12-31
Input rows5,283 per asset
Evaluation periodEntry at the 2007-01-03 close; liquidation at the 2025-12-31 close
Evaluation trading days4,780
Initial capital$10,000
Buy-and-holdBuy each asset at a one-third weight initially, make no interim rebalances, and liquidate at the end
12-month momentumSelect assets whose month-end adjusted close exceeds their adjusted close 12 month-ends earlier, and hold them at equal weights
Cash allocationHold all cash if no asset qualifies
Execution timingExecute month-end signals at the next observed trading day's close
Transaction costs0, 5, 10, or 20 basis points on each purchase and sale
Where costs applyInitial entry, interim rebalances, and final liquidation
Other assumptionsZero interest on cash; fractional units allowed
ExclusionsTaxes, currency conversion fees, market impact, and additional spreads

The momentum rule is:

text
12-month return = current month-end adjusted close / adjusted close 12 month-ends earlier - 1

Only assets with a return greater than zero qualify. If all three qualify, each receives one-third; if two qualify, each receives one-half; if one qualifies, it receives the full allocation. If all returns are zero or negative, the portfolio stays in cash.

Comparing against 12 month-ends earlier requires 13 month-end observations. The input begins in 2005, but 2005–2006 serves as preparation for signal calculation before evaluation starts.

The calculation does not use a month-end price both to generate a signal and to execute it immediately. Target weights are applied at the next observed trading day's close; price changes through that close belong to the existing holdings.

The evaluation period, assets, and cost rates are conditions of this educational run. This is not a preregistered independent out-of-sample validation. In this work, I did not search multiple periods or thresholds and select only favorable results.

2. What using adjusted closes means

The calculation uses Yahoo Finance adjclose. The provider's explanation of adjusted closing prices is available in Yahoo Help.

The runner treats this series as a price index approximating dividend reinvestment. Accordingly, units in the transaction ledger are adjusted-price accounting units, not actual ETF share counts.

That distinction leads to two rules:

  • Do not add separate dividend cash flows.
  • Do not interpret the recorded units as quantities to order in a real account.

Adding dividend cash flows again to a calculation whose prices already reflect their effect can double-count them. Transaction costs are also an approximation, applied to traded value calculated from these adjusted prices.

The input is historical data downloaded at execution time. It does not reconstruct the data versions available at each historical point or actual execution prices.

Before calculating, the runner checks:

  • Whether all three assets have the same date set.
  • Whether there are duplicate dates.
  • Whether every price is present, finite, and positive.

It stops if these conditions fail. It does not fill missing values arbitrarily or continue using only the dates shared by all three assets.

These checks establish input structure and calculability, not an independent validation of the provider's prices. Asset-selection bias and possible provider revisions or errors remain limitations.

3. Results: momentum did not lead even without transaction costs

StrategyOne-way costEnding value ($)Annualized returnMaximum drawdown
Buy-and-hold0bp50,328.598.88%-20.75%
Buy-and-hold5bp50,278.298.88%-20.75%
Buy-and-hold10bp50,228.048.87%-20.75%
Buy-and-hold20bp50,127.688.86%-20.75%
12-month momentum0bp48,990.048.73%-23.55%
12-month momentum5bp47,657.558.57%-23.86%
12-month momentum10bp46,361.298.41%-24.16%
12-month momentum20bp43,873.588.10%-24.78%

Annualized return is calculated as follows:

text
Elapsed years = calendar days from evaluation start to end / 365.25Annualized return = (ending wealth / 10,000) ** (1 / elapsed years) - 1

Maximum drawdown measures each daily portfolio value's decline from its preceding peak and takes the largest decline. The starting $10,000 is included as the initial reference point, and final liquidation costs are reflected in ending value.

At 10bp, the difference in ending wealth was $3,866.75.

The momentum ledger contains 228 monthly target-weight application events, including initial entry, plus one final liquidation. Buy-and-hold has only initial entry and final liquidation. These event counts are not counts of individual asset orders.

What the results establish, and what remains unexplained

CategoryWhat this run supports
Observed factMomentum had lower ending wealth at all four cost rates.
Observed factMomentum had a lower annualized return even at 0bp.
Observed factMomentum had a larger maximum drawdown at all four cost rates.
Causes not isolatedHow much asset selection, cash holding, and equal-weight rebalancing each contributed
Outside this calculationWhether other periods and assets behave similarly, or whether the result holds in the future

Because the gap exists even without costs, costs alone cannot explain why momentum lagged.

Nor can I conclude that cash holding or exclusion of a particular asset caused the result. Asset selection, cash weights, monthly equal-weight rebalancing, and drifting buy-and-hold weights all operate together in this comparison. I did not run separate experiments changing each factor to decompose its contribution.

4. Reading the accounting through one ledger entry

A summary table does not show how signals become trades and costs.

The following is the 2007-02-01 entry from the public momentum 10bp transaction ledger. It presents existing ledger values in a more readable form; it is not a new experiment.

ItemLedger entry
Signal date2007-01-31
Target-weight execution2007-02-01 close
Target weightsOne-third each in SPY, IEF, and GLD
Pre-trade portfolio valueApproximately $10,198.184057
Total purchase and sale notionalApproximately $189.531536
One-way cost rate0.1%, or 10bp
Transaction costApproximately $0.189532
Post-trade cash$0
Post-trade unitsSPY approximately 33.695133; IEF 68.798155; GLD 52.120997

The cost is not 0.1% of total portfolio value. It is the cost rate multiplied by the total value actually bought and sold.

text
$189.531536 × 0.001 ≈ $0.189532

Trades can occur even when target weights remain one-third each. If asset prices move differently while holding units stay fixed, portfolio weights drift. Restoring one-third weights requires purchases and sales.

The units in this table use adjusted-price accounting. They are not a record of trading those share quantities in a real account.

5. Accounting rules checked before interpreting returns

Buy-and-hold preserves holding units

Weights change over time even when each asset initially receives one-third.

Averaging the three daily asset returns at fixed one-third weights would calculate a strategy rebalanced daily to equal weights. This buy-and-hold calculation instead keeps units fixed after entry and lets weights move with prices.

Momentum targets weights after paying transaction costs

Buying up to the full pre-cost portfolio value and only then deducting fees can exceed available cash.

The runner solves the following relation by bisection, calculating post-cost wealth and target units together:

text
Transaction cost= one-way cost rate × Σ |target weight × post-cost wealth - current holding value|Post-cost wealth + transaction cost= pre-trade wealth

Checks recorded at execution time

The 2026-10-19 run passed these nine unit tests:

  1. Initial entry costs.
  2. Liquidation after a price change.
  3. Zero cost when no trade occurs.
  4. Wealth conservation across trading.
  5. Buy-and-hold comparison with an independent formula.
  6. Rejection of invalid prices.
  7. Attribution of execution-day returns.
  8. Drawdown including initial capital.
  9. Twelve-month month-end signals and next-trading-day execution.

Buy-and-hold results on the actual data were also compared with an independent formula at all four cost rates. A further check removed rows after 2021 and confirmed that signals already fixed before that cutoff did not change.

These checks cover parts of the specified accounting rules. They do not guarantee the absence of every implementation error or establish profitability.

6. What the public materials let you check

The materials are available here:

The ZIP includes code, tests, and results for two strategies at four cost rates. It does not include raw price data.

Python 3.9 or later is required, with only the standard library and no additional packages. The recorded execution environment was macOS with Python 3.14.5.

Extract the ZIP into a separate folder and run the following commands from the directory containing backtest.py and test_backtest.py.

First: unit tests of the accounting rules

sh
python3 -m unittest -v

This checks accounting and signal rules using the examples in the tests. It does not download prices or reproduce the published results.

If a test fails, examine that failure before continuing.

Second: download prices and calculate new results

sh
python3 backtest.py --download --data market-inputs --out my-results

This downloads prices from Yahoo into market-inputs and writes calculated outputs to my-results.

Both must be new paths that do not already exist. Use different names if you have run the command before.

Downloading requires network and provider access. If it fails partway through, do not treat partial files as a complete input set; retry with a new input directory.

Third: check the new outputs and input match

sh
python3 verify.py --data market-inputs --results my-results

This recomputes results from the supplied input and compares them with my-results. It also checks buy-and-hold with a separate formula at the four cost rates.

Successful checks print:

text
PASS: 17 regenerated output files and 4 closed-form comparisons

This PASS alone does not mean the results match the published run.

It means the outputs generated from the input just used match a recalculation, and the independent buy-and-hold formula checks passed.

Check the following line separately:

text
Published input matches: True

It may instead say:

text
Published input matches: False
OutputMeaning
PASSRecomputed outputs for the specified input match the specified results directory, and independent formula checks pass.
Published input matches: TrueThe SHA-256 of normalized dates and prices matches the published input record.
Published input matches: FalseThe input differs from the published run; classify this as a calculation using new data.

If the input matches, compare the results in my-results/results.json with the published reference-results/results.json, including ending value, annualized return, and maximum drawdown.

With --results my-results, the 17-file comparison in the current verify.py is between newly generated outputs and recomputed outputs. It should not be mistaken for a comparison against the entire published reference-results directory.

Downloading again may not reproduce the same numbers

Provider revisions or access restrictions can change downloaded values or make downloads fail.

Input matching uses normalized_prices_sha256. A raw JSON hash can change because of metadata unrelated to prices, so a different raw-file hash alone does not establish different prices.

The verifier also compares output files byte for byte. Differences in floating-point representation between Python versions can cause a file mismatch. When a mismatch occurs, examine the input, environment, and numerical differences separately.

The original price snapshot is preserved in a private backup. Since that snapshot is not part of the public materials, external readers are not guaranteed to obtain the same input again.

Record passing code checks, calculating with newly obtained input, and reproducing the published results as separate outcomes.

7. What this calculation answered, and the questions left open

This run calculated buy-and-hold and 12-month momentum through to their final results under fixed price data and trading rules.

For the selected period and assets, momentum showed neither a higher return nor a smaller maximum drawdown. Its return was lower even without transaction costs, so costs alone could not explain the difference.

The following questions remain unanswered:

  • How much did cash holding, asset selection, and equal-weight rebalancing each contribute?
  • Do other evaluation periods or price datasets produce similar results?
  • How much does including cash interest change the outcome?
  • What changes if logistic regression or tree models are added under the same comparison rules?

These require separate experiments. Later design articles and synthetic-data checks should not be reinterpreted as performance validation on this market dataset.

Further experiments should preserve these conditions and results, recording changed assumptions and new results separately. This result is a baseline for those comparisons, not an investment recommendation or evidence of future returns.

Report an error or share feedback

Open a draft with this article’s title and URL. Review the message and recipient before sending.

To: [email protected]

Open email draft

If no email app opens, copy these details into your usual email service.

Contact information