Skip to main content

FutureOptionTemplate

Struct FutureOptionTemplate 

pub struct FutureOptionTemplate {
    pub name: String,
    pub exchange: FuturesExchange,
    pub underlying_root: &'static str,
    pub currency: Currency,
    pub premium_style: PremiumStyle,
    pub exercise: ExerciseStyle,
    pub point_value: f64,
    pub tick: Option<f64>,
    pub strike_interval: Option<f64>,
    pub expiry_rule: OptionExpiryRule,
    pub calendar_centers: &'static str,
    pub source: &'static str,
}
Expand description

The terms of one listed option on a bond future.

Fields§

§name: String

Template name (doubles as registry code), e.g. CBOT-OZN.

§exchange: FuturesExchange

The exchange the option and its future trade on.

§underlying_root: &'static str

The root of the future the option exercises into, e.g. ZN.

§currency: Currency

The currency premiums and margin settle in.

§premium_style: PremiumStyle

Futures-style or paid.

§exercise: ExerciseStyle

European or American.

§point_value: f64

What one price point is worth per contract.

§tick: Option<f64>

The minimum price fluctuation, in price points; None where unsourced.

§strike_interval: Option<f64>

The listed strike interval, in price points; None where unsourced.

§expiry_rule: OptionExpiryRule

How an option month’s expiry is computed.

§calendar_centers: &'static str

Calendar expression the expiry is computed on.

§source: &'static str

The document the row was taken from.

Implementations§

§

impl FutureOptionTemplate

pub fn calendar(&self) -> Arc<dyn Calendar>

The calendar the expiry is computed on.

pub fn underlying( &self, year: i32, month: u32, ) -> Result<ListedFutureId, FutureOptionTemplateError>

The future an option of year-month exercises into: the same month’s for a quarterly month (March, June, September, December), the next quarterly month’s for a serial one.

§Errors

FutureOptionTemplateError::Month for a year or month that names no listed future.

pub fn expiry( &self, year: i32, month: u32, ) -> Result<NaiveDate, FutureOptionTemplateError>

The last trading day of the option of year-month, by the template’s rule on its calendar.

§Errors

FutureOptionTemplateError::HolidayExpiry where the rule lands on a day that is not a business day and the source states no rule for it; FutureOptionTemplateError::Month for a month outside 1–12.

§

impl FutureOptionTemplate

pub fn weekly( &self, designated: NaiveDate, ) -> Result<(NaiveDate, ListedFutureId), FutureOptionTemplateError>

The last trading day of the weekly option designated to expire on designated, and the quarterly future it exercises into (CBOT xxA01.D.3–7 and xxA01.I.2–6).

§Errors

FutureOptionTemplateError::Weekly for a template whose exchange’s weeklies are not drafted, a weekend, a Monday to Thursday holiday, or a day another option of the contract trades last on; FutureOptionTemplateError::HolidayExpiry where the quarterly option that decides the future lands on a holiday.

Trait Implementations§

§

impl Clone for FutureOptionTemplate

§

fn clone(&self) -> FutureOptionTemplate

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for FutureOptionTemplate

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.