The ex-dividend date helps determine who receives a dividend. The payment date tells you when the company pays it. A backtest needs both because an unpaid dividend can contribute to portfolio value without funding a purchase.

We use an ordinary cash dividend and an eligible long position here. Special distributions, stock dividends, borrowed shares, taxes, and broker-specific arrangements require additional rules.

The dates answer different questions

Investor.gov's explanation of dividend dates distinguishes the record date from the ex-dividend date. The record date identifies holders on the company's books. Under the ordinary cash-dividend case described there, buying on or after the ex-dividend date does not give the buyer the upcoming dividend. The seller retains it.

The declaration announces the dividend and its terms. The payment date is when the company pays. For a simulation, add a separate cash-availability assumption: when does the account actually have usable funds? Do not silently replace that assumption with the ex-dividend date.

Use the announced dates for the event you are modeling. Investor.gov describes exceptions for large and stock distributions, so a single date rule should not be applied to every corporate action. The worked ledger below intentionally excludes those exceptions.

A $100 holding through a $2 dividend

Assume one eligible share, no starting cash, and a $2 dividend. The stock closes at $100 before the ex-date and $98 on it. It stays at $98 until payment. All prices and amounts are synthetic; actual prices respond to other information too.

Synthetic ledger with no fees, taxes, trades, or other cash flows.
PointStock valueUnpaid claimCashTotal value
Before ex-date$100$0$0$100
On ex-date$98$2$0$100
Cash credited$98$0$2$100

At the ex-date, the eligible position earns a receivable: money owed to the account. Here, total value is stock value + unpaid claim + cash. When the payment becomes available, move $2 from the claim to cash. Adding $2 to cash while leaving the claim in place would incorrectly report $102.

The accounting check is simple: payment alone must not create a second gain. Keep an event identifier so a repeated payment record cannot credit the same claim twice.

What if the shares are sold?

Under the ordinary-dividend assumption above, selling the eligible share on the ex-date does not erase its dividend claim. If the sale produces $98 of usable cash in our simplified model, the account has $98 cash and a $2 receivable. Its total value remains $100. The model assumes sale proceeds are immediately usable; actual settlement and buying-power rules need separate treatment.

A buyer on the ex-date does not inherit that upcoming $2 payment. A program that simply pays whichever account holds the shares on payment day can therefore credit the wrong holder. Store entitlement when it is established, then settle the saved claim.

Why reinvestment timing changes the result

A cash-only simulation with $98 available and a $2 unpaid claim cannot fund a $100 purchase. Including receivables in buying power would let the simulation spend money early. A total-return index may use a stated reinvestment convention; that convention does not establish the funding available in an account.

To test this distinction, use our Python accounting companion. It includes ordinary-dividend holding, ex-date buying and selling, and waiting-for-cash cases. Change the synthetic payment date and inspect when a purchase becomes possible. It is an educational model, not a broker settlement engine or the original private research implementation.

Before calculating any of this, confirm that the event belongs to the security. Our dividend-record investigation explains why a matching ticker was insufficient. If you are using adjusted prices as well, check the price-adjustment guide to avoid counting the dividend twice.