← ClaudeAtlas

ex-dividend-and-rebate-interestlisted

Handle bonds that trade ex-dividend, where accrued interest goes negative and the buyer is paid rebate interest instead of paying it. TRIGGER - gilt, UK gilt, ex-dividend, ex-div, ex-coupon, exCouponPeriod, rebate interest, negative accrued interest, "my accrued interest is negative", "accrued should be negative but isn't", seven business days before the coupon, quasi-coupon date, DMO formulae, "Formulae for Calculating Gilt Prices from Yields", ql.FixedRateBond exCouponPeriod, ql.Period(-7, ql.Days), record date vs ex-date on a bond, 3.5% War Loan, JGB and gilt settlement. SKIP for ordinary positive accrued and day-count choice (bond-conventions-and-accrued), for price-to-yield solving in general (yield-measures-and-bill-quotes), for index-linked gilt indexation lags (../../../fin-models/skills/term-structure-models), and for QuantLib's evaluationDate global (../../../fin-libraries/skills/lib-quantlib).
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# Ex-dividend and rebate interest **A gilt bought inside its ex-dividend window does not receive the coupon that is about to be paid, so accrued interest is NEGATIVE.** Most fixed-income code has no branch for this. The code that does can have the sign backwards and never fail. Every figure below is printed by `scripts/ex_dividend.py` (runs in **0.15 s**; QuantLib optional). ✅ Measured means this file produced it on 2026-09-09 with QuantLib 1.43, Python 3.11.3. The worked bond is a **4% gilt, coupons 7 Jun / 7 Dec, maturity 2035-06-07, y = 4.20%**, and the coupon in question is **2026-12-07 (a Monday)**, whose ex-dividend date is **2026-11-26**. > **The rule: inside the window `AI = (t/s − 1)·d1`, which is negative — and QuantLib's > `exCouponPeriod` counts days BACK from the coupon, so it takes `Period(7, Days)` and never > `Period(-7, Days)`.** ## 1. ✅ The rule, from the source ✅ **UK DMO, "Formulae for Calculating Gilt Prices from Yields", 4th edition, 18 December 2024, Note 5** (read 2026-09-09): the ex-dividend date for all gilts is currently the date **seven business days** before the dividend date. ✅ Section Three (1)(i), the accrued-interest formula, verbatim in structure: ``` AI = (t/s) * d1 if the settlement date occurs on or before the ex-dividend date AI = (t/s - 1) * d1 if the settlement date occurs after the ex-dividend date ``` with `t` = calendar days from the previous quasi-coupon date to settlement, `s` = calendar days in the full quasi-c