Skip to main content

InstrumentGreeksParamsBuilder

Struct InstrumentGreeksParamsBuilder 

Source
pub struct InstrumentGreeksParamsBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> InstrumentGreeksParamsBuilder<S>

Source

pub fn build(self) -> InstrumentGreeksParams
where S: IsComplete,

Finish building and return the requested object

Source

pub fn instrument_id( self, value: InstrumentId, ) -> InstrumentGreeksParamsBuilder<SetInstrumentId<S>>
where S::InstrumentId: IsUnset,

Required.

The instrument ID to calculate greeks for

Source

pub fn flat_interest_rate( self, value: f64, ) -> InstrumentGreeksParamsBuilder<SetFlatInterestRate<S>>
where S::FlatInterestRate: IsUnset,

Optional (Some / Option setters). Default: 0.0425.

Flat interest rate (default: 0.0425)

Source

pub fn maybe_flat_interest_rate( self, value: Option<f64>, ) -> InstrumentGreeksParamsBuilder<SetFlatInterestRate<S>>
where S::FlatInterestRate: IsUnset,

Optional (Some / Option setters). Default: 0.0425.

Flat interest rate (default: 0.0425)

Source

pub fn flat_dividend_yield( self, value: f64, ) -> InstrumentGreeksParamsBuilder<SetFlatDividendYield<S>>
where S::FlatDividendYield: IsUnset,

Optional (Some / Option setters). Flat dividend yield

Source

pub fn maybe_flat_dividend_yield( self, value: Option<f64>, ) -> InstrumentGreeksParamsBuilder<SetFlatDividendYield<S>>
where S::FlatDividendYield: IsUnset,

Optional (Some / Option setters). Flat dividend yield

Source

pub fn spot_shock( self, value: f64, ) -> InstrumentGreeksParamsBuilder<SetSpotShock<S>>
where S::SpotShock: IsUnset,

Optional (Some / Option setters). Default: 0.0.

Spot price shock (default: 0.0)

Source

pub fn maybe_spot_shock( self, value: Option<f64>, ) -> InstrumentGreeksParamsBuilder<SetSpotShock<S>>
where S::SpotShock: IsUnset,

Optional (Some / Option setters). Default: 0.0.

Spot price shock (default: 0.0)

Source

pub fn vol_shock( self, value: f64, ) -> InstrumentGreeksParamsBuilder<SetVolShock<S>>
where S::VolShock: IsUnset,

Optional (Some / Option setters). Default: 0.0.

Volatility shock (default: 0.0)

Source

pub fn maybe_vol_shock( self, value: Option<f64>, ) -> InstrumentGreeksParamsBuilder<SetVolShock<S>>
where S::VolShock: IsUnset,

Optional (Some / Option setters). Default: 0.0.

Volatility shock (default: 0.0)

Source

pub fn time_to_expiry_shock( self, value: f64, ) -> InstrumentGreeksParamsBuilder<SetTimeToExpiryShock<S>>
where S::TimeToExpiryShock: IsUnset,

Optional (Some / Option setters). Default: 0.0.

Time to expiry shock (default: 0.0)

Source

pub fn maybe_time_to_expiry_shock( self, value: Option<f64>, ) -> InstrumentGreeksParamsBuilder<SetTimeToExpiryShock<S>>
where S::TimeToExpiryShock: IsUnset,

Optional (Some / Option setters). Default: 0.0.

Time to expiry shock (default: 0.0)

Source

pub fn use_cached_greeks( self, value: bool, ) -> InstrumentGreeksParamsBuilder<SetUseCachedGreeks<S>>
where S::UseCachedGreeks: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to use cached greeks (default: false)

Source

pub fn maybe_use_cached_greeks( self, value: Option<bool>, ) -> InstrumentGreeksParamsBuilder<SetUseCachedGreeks<S>>
where S::UseCachedGreeks: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to use cached greeks (default: false)

Source

pub fn update_vol( self, value: bool, ) -> InstrumentGreeksParamsBuilder<SetUpdateVol<S>>
where S::UpdateVol: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to update vol from cached greeks (default: false)

Source

pub fn maybe_update_vol( self, value: Option<bool>, ) -> InstrumentGreeksParamsBuilder<SetUpdateVol<S>>
where S::UpdateVol: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to update vol from cached greeks (default: false)

Source

pub fn cache_greeks( self, value: bool, ) -> InstrumentGreeksParamsBuilder<SetCacheGreeks<S>>
where S::CacheGreeks: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to cache greeks (default: false)

Source

pub fn maybe_cache_greeks( self, value: Option<bool>, ) -> InstrumentGreeksParamsBuilder<SetCacheGreeks<S>>
where S::CacheGreeks: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to cache greeks (default: false)

Source

pub fn publish_greeks( self, value: bool, ) -> InstrumentGreeksParamsBuilder<SetPublishGreeks<S>>
where S::PublishGreeks: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to publish greeks (default: false)

Source

pub fn maybe_publish_greeks( self, value: Option<bool>, ) -> InstrumentGreeksParamsBuilder<SetPublishGreeks<S>>
where S::PublishGreeks: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to publish greeks (default: false)

Source

pub fn ts_event( self, value: UnixNanos, ) -> InstrumentGreeksParamsBuilder<SetTsEvent<S>>
where S::TsEvent: IsUnset,

Optional (Some / Option setters). Event timestamp

Source

pub fn maybe_ts_event( self, value: Option<UnixNanos>, ) -> InstrumentGreeksParamsBuilder<SetTsEvent<S>>
where S::TsEvent: IsUnset,

Optional (Some / Option setters). Event timestamp

Source

pub fn position( self, value: Position, ) -> InstrumentGreeksParamsBuilder<SetPosition<S>>
where S::Position: IsUnset,

Optional (Some / Option setters). Position for PnL calculation

Source

pub fn maybe_position( self, value: Option<Position>, ) -> InstrumentGreeksParamsBuilder<SetPosition<S>>
where S::Position: IsUnset,

Optional (Some / Option setters). Position for PnL calculation

Source

pub fn percent_greeks( self, value: bool, ) -> InstrumentGreeksParamsBuilder<SetPercentGreeks<S>>
where S::PercentGreeks: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to compute percent greeks (default: false)

Source

pub fn maybe_percent_greeks( self, value: Option<bool>, ) -> InstrumentGreeksParamsBuilder<SetPercentGreeks<S>>
where S::PercentGreeks: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to compute percent greeks (default: false)

Source

pub fn index_instrument_id( self, value: InstrumentId, ) -> InstrumentGreeksParamsBuilder<SetIndexInstrumentId<S>>
where S::IndexInstrumentId: IsUnset,

Optional (Some / Option setters). Index instrument ID for beta weighting

Source

pub fn maybe_index_instrument_id( self, value: Option<InstrumentId>, ) -> InstrumentGreeksParamsBuilder<SetIndexInstrumentId<S>>
where S::IndexInstrumentId: IsUnset,

Optional (Some / Option setters). Index instrument ID for beta weighting

Source

pub fn beta_weights( self, value: HashMap<InstrumentId, f64>, ) -> InstrumentGreeksParamsBuilder<SetBetaWeights<S>>
where S::BetaWeights: IsUnset,

Optional (Some / Option setters). Beta weights for portfolio calculations

Source

pub fn maybe_beta_weights( self, value: Option<HashMap<InstrumentId, f64>>, ) -> InstrumentGreeksParamsBuilder<SetBetaWeights<S>>
where S::BetaWeights: IsUnset,

Optional (Some / Option setters). Beta weights for portfolio calculations

Source

pub fn vega_time_weight_base( self, value: i32, ) -> InstrumentGreeksParamsBuilder<SetVegaTimeWeightBase<S>>
where S::VegaTimeWeightBase: IsUnset,

Optional (Some / Option setters). Base value in days for time-weighting vega

Source

pub fn maybe_vega_time_weight_base( self, value: Option<i32>, ) -> InstrumentGreeksParamsBuilder<SetVegaTimeWeightBase<S>>
where S::VegaTimeWeightBase: IsUnset,

Optional (Some / Option setters). Base value in days for time-weighting vega

Source

pub fn vol_index_instrument_id( self, value: InstrumentId, ) -> InstrumentGreeksParamsBuilder<SetVolIndexInstrumentId<S>>
where S::VolIndexInstrumentId: IsUnset,

Optional (Some / Option setters). Volatility index instrument ID for vega beta weighting, for example VIX.

Source

pub fn maybe_vol_index_instrument_id( self, value: Option<InstrumentId>, ) -> InstrumentGreeksParamsBuilder<SetVolIndexInstrumentId<S>>
where S::VolIndexInstrumentId: IsUnset,

Optional (Some / Option setters). Volatility index instrument ID for vega beta weighting, for example VIX.

Source

pub fn vol_beta_weights( self, value: HashMap<InstrumentId, f64>, ) -> InstrumentGreeksParamsBuilder<SetVolBetaWeights<S>>
where S::VolBetaWeights: IsUnset,

Optional (Some / Option setters). Volatility beta weights for portfolio vega calculations

Source

pub fn maybe_vol_beta_weights( self, value: Option<HashMap<InstrumentId, f64>>, ) -> InstrumentGreeksParamsBuilder<SetVolBetaWeights<S>>
where S::VolBetaWeights: IsUnset,

Optional (Some / Option setters). Volatility beta weights for portfolio vega calculations

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<T> Ungil for T
where T: Send,

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more