Skip to content

Release note

Backtests now include dividends, withholding tax and UK stamp duty

3 min read
backtestaccuracyUK

Every backtest used to count price moves only, which badly understates income-paying shares, and UK stamp duty was mentioned on the card but never charged. From 28 September results are total return by default: dividends are credited and reinvested after withholding tax, stamp duty is charged on UK share purchases, and the card itemises every cost. Results from before this change are price only, so running a prompt again gives you the total-return figure; old cached results are not reused.

How dividends are handled. A dividend is credited on its ex-date to the shares held at the previous close, less withholding tax. It is reinvested at that day's close: through the rebalance if that day is a rebalance day, otherwise in the holding that paid it. Cash receives no dividends and earns the risk-free rate instead. Signals still read prices only, so a golden cross trades on the same days either way. The benchmark runs on the same basis as the strategy.

Withholding tax. Rates are set for a UK-resident individual and deducted at source: nothing on UK dividends, and 15% on US dividends (the treaty rate with a W-8BEN form). Several European rates, including Germany's, France's, Italy's, Spain's and Switzerland's, are higher at source than the treaty rate. They are flagged on the card, because reclaiming the difference takes paperwork we don't model.

Stamp duty. 0.5% is charged on purchases of shares in UK-incorporated companies listed in London, investment trusts included, and 1% on Irish-incorporated shares. ETFs are exempt, and nothing is charged on sales. Because it is a tax rather than a broker cost, it is included in every cost setting.

Every cost itemised. The costs section lists slippage, commission, stamp duty and dividend withholding, each with its total and its drag in percentage points a year, plus the dividends credited and the same run without dividends for comparison. The money line names exactly what was charged, for example "including dividends reinvested, after stamp duty". The reproduce download now includes every fill's costs and every dividend, and its script recomputes them. For quants: each drag is the CAGR with that charge left invested minus the headline CAGR, a first-order measure.

No silent downgrade. If we can't confirm dividend history for a symbol in your run, the strategy and the benchmark both run on prices only, and the card says so first, naming the symbol. A large dividend record that the share price didn't reflect on its ex-date (a payout above 10% of the price needs the price to fall by at least half the payout) is never credited, and any backtest that spans one names it. While building this we also found that an out-of-date list of non-payers had kept NVDA, META, GOOGL and GOOG dividends out of our data; they are in now.

What it looks like. Over the five years to 24 September, a 50/200-day golden cross on SPY went from 10.12% a year on prices alone to 11.03% with dividends after 15% withholding. The same rule on HSBC (HSBA.L) went from 22.00% to 27.87%, after 0.68 percentage points a year of stamp duty. Buying and holding the FTSE 100 ETF ISF.L went from 8.62% to 12.61%. With costs switched off, the engine's buy-and-hold total return matches an independent calculation to four decimal places.

Not modelled. Income tax and capital gains tax on your gains, EU financial transaction taxes, the Swiss transfer tax, and changes in tax rules over time: today's rules are applied to the whole history. Spin-offs are left out rather than converted into shares.