Quant Memo
Core

Corporate Actions Inside the Simulation Loop

A backtest that ignores splits, dividends, and mergers mid-simulation will misprice positions and generate phantom returns — corporate actions need to be applied at the exact simulated date, not just cleaned up in the raw price history beforehand.

Prerequisites: Corporate Action Handling

Most backtests use price series that have already been adjusted for splits and dividends, which handles the easy case, but a simulation that holds live positions and marks them to market day by day needs corporate actions handled inside the loop, at the moment they actually occur, not just baked into a static adjusted price history computed in advance. If a stock splits 2-for-1 on day 40 of a 100-day simulation, a position of 100 shares needs to become 200 shares on exactly that day with the price halved — get the timing wrong by even one day and the simulated portfolio's market value jumps or drops for no real reason.

The reason this is easy to get wrong is that pre-adjusted price series are usually adjusted retroactively across the whole history using today's cumulative factor, which is fine for computing a return series but wrong for a position-level simulation: the simulator needs to know the share count and cash effects at the actual event date, including dividend cash that needs to be added to a portfolio's cash balance on the ex-date, not smeared invisibly into the price series. Mergers and spin-offs are harder still, since they can turn one position into a combination of cash and shares in a different security, which the simulation loop has to model as an explicit event rather than a price adjustment.

Getting this wrong tends to inflate backtest performance quietly: a simulation that fails to add dividend cash on the ex-date effectively "loses" that cash flow if it isn't also reducing the price correctly for it, or double-counts it if it does both without reconciling — and a stale share count around a split can cause leverage and position-size calculations to be wrong for the rest of the backtest.

Corporate actions must be applied to a simulated portfolio's actual share count, cash balance, and price on the real event date inside the simulation loop — treating them purely as a pre-computed price adjustment applied to raw history is not sufficient once the simulation is tracking live positions rather than just return series.

Related concepts

Further reading

  • Bailey, Borwein, López de Prado, Zhu, Backtest Overfitting
ShareTwitterLinkedIn