Skip to main content

anbima_price

Function anbima_price 

pub fn anbima_price(
    bond: &InflationLinkedBond,
    convention: LinkerConvention,
    tir: f64,
    settlement: NaiveDate,
    vna: f64,
    calendar: &dyn Calendar,
) -> Result<AnbimaQuote, LinkerQuoteError>
Expand description

The ANBIMA quotation at a real yield (tir, per annum as a decimal).

Each flow is discounted by (1+tir)^{du/252} with the exponent truncated to fourteen places, each parcel rounded to ten, the quotation truncated to four, and the price truncated to six. du counts business days on calendar from settlement inclusive to payment exclusive.

ยงErrors

LinkerQuoteError::WrongFamily outside the ANBIMA convention.