Skip to main content

bond_future_option_from_template

Function bond_future_option_from_template 

pub fn bond_future_option_from_template(
    code: &str,
    year: i32,
    month: u32,
    strike: f64,
    kind: OptionKind,
) -> Result<BondFutureOption, BondFutureOptionError>
Expand description

One long contract of the option of year-month under the futures option template code, struck at strike per 100: the template’s premium style, exercise style, currency and point value, its expiry by the template’s rule on its calendar, and its underlying the quarterly future the month exercises into.

§Errors

BondFutureOptionError::Template for a code that names no futures option template, a month outside 1–12, or an expiry the rule lands on a holiday for (state the expiry and build with BondFutureOption::new); BondFutureOptionError::Strike for a strike that is not finite.