← ClaudeAtlas

bond-conventions-and-accruedlisted

Compute accrued interest, clean and dirty prices and day-count year fractions on a bond without silently picking the wrong convention. TRIGGER - accrued interest, day count, daycount, ACT/ACT ICMA vs ISMA vs ISDA, ACT/365F, ACT/360, 30/360, 30E/360, 30E/360 ISDA, Thirty360 BondBasis vs USA vs European vs NASD, year fraction, yearFraction, ActualActual(ISMA), "my accrued interest is off by a few hundred dollars", "which 30/360 is this", clean price vs dirty price vs invoice price, settlement amount, T+1 settlement, quasi-coupon date, first and last stub period. SKIP for negative accrued inside a gilt ex-dividend window (ex-dividend-and-rebate-interest), for turning a price into a yield (yield-measures-and-bill-quotes), for duration and DV01 (duration-convexity-and-dv01), for discount-curve conventions and compounding (../../../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
# Bond conventions and accrued **Accrued interest is not a number. It is a number plus three things: a day-count convention, a coupon schedule, and a settlement date.** Drop any one and you still get a plausible answer. Every figure below is printed by `scripts/conventions.py` (runs in **0.15 s**; QuantLib optional, imported inside `quantlib_cross_checks`). ✅ Measured means this file produced it on 2026-09-09 with QuantLib 1.43, Python 3.11.3. The worked bond is a **5% semiannual, coupon period 2026-01-15 → 2026-07-15 (181 days), settled 2026-04-30 (105 days in), 1,000,000 face**. > **The rule: carry (day count, coupon schedule, settlement date) together.** ACT/ACT ICMA > evaluated from two bare dates is a guess, "30/360" alone does not name a convention, and the > screen quotes clean while the wire settles dirty. ## 1. 🚨 ACT/ACT ICMA without its schedule returns 0.25 and no error ACT/ACT ICMA (= ISMA = "Bond") is `days / (coupon-period days × coupons per year)`. **The denominator is the coupon period, not the year**, so two dates are not enough to evaluate it. ✅ Source-verified in QuantLib's own `ql/time/daycounters/actualactual.cpp` (read 2026-09-09): `implementation()` dispatches `case ISMA: case Bond: if (!schedule.empty())` → `ISMA_Impl`, **`else` → `Old_ISMA_Impl`** — whose comment says the reference period is taken "equal to (d1,d2)" when unspecified, and which then estimates `months = lround(12 * (refPeriodEnd - refPeriodStart) / 365)`. ✅ Measured on the worke