Function cme_conversion_factor
pub fn cme_conversion_factor(
coupon: f64,
maturity: NaiveDate,
delivery_month_start: NaiveDate,
rounding: CmeMaturityRounding,
) -> f64Expand description
The CME Treasury futures conversion factor: the price of $1 of the bond
at a 6% yield, a·[(coupon/2) + c + d] − b, rounded to four decimals, as
CME’s Calculating U.S. Treasury Futures Conversion Factors defines it.
coupon is the annual coupon as a decimal (0.0375), rounded here to the
nearest 1/8% with ties up. Remaining maturity runs in whole months from
delivery_month_start (the first day of the delivery month) to maturity
(or the call date): n whole years and z further months, z rounded
down to a quarter under CmeMaturityRounding::Quarter. Then v = z for
z < 7, else z − 6; a = 1.03^(−v/6); b = (coupon/2)(6 − v)/6;
c = 1.03^(−2n) for z < 7, else 1.03^(−(2n+1)); d = (coupon/0.06)(1 − c).