Skip to main content

PortfolioGreeksParamsBuilder

Struct PortfolioGreeksParamsBuilder 

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

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

Implementations§

Source§

impl<S: State> PortfolioGreeksParamsBuilder<S>

Source

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

Finish building and return the requested object

Source

pub fn underlyings( self, value: Vec<String>, ) -> PortfolioGreeksParamsBuilder<SetUnderlyings<S>>
where S::Underlyings: IsUnset,

Optional (Some / Option setters). List of underlying symbols to filter by

Source

pub fn maybe_underlyings( self, value: Option<Vec<String>>, ) -> PortfolioGreeksParamsBuilder<SetUnderlyings<S>>
where S::Underlyings: IsUnset,

Optional (Some / Option setters). List of underlying symbols to filter by

Source

pub fn venue(self, value: Venue) -> PortfolioGreeksParamsBuilder<SetVenue<S>>
where S::Venue: IsUnset,

Optional (Some / Option setters). Venue to filter positions by

Source

pub fn maybe_venue( self, value: Option<Venue>, ) -> PortfolioGreeksParamsBuilder<SetVenue<S>>
where S::Venue: IsUnset,

Optional (Some / Option setters). Venue to filter positions by

Source

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

Optional (Some / Option setters). Instrument ID to filter positions by

Source

pub fn maybe_instrument_id( self, value: Option<InstrumentId>, ) -> PortfolioGreeksParamsBuilder<SetInstrumentId<S>>
where S::InstrumentId: IsUnset,

Optional (Some / Option setters). Instrument ID to filter positions by

Source

pub fn strategy_id( self, value: StrategyId, ) -> PortfolioGreeksParamsBuilder<SetStrategyId<S>>
where S::StrategyId: IsUnset,

Optional (Some / Option setters). Strategy ID to filter positions by

Source

pub fn maybe_strategy_id( self, value: Option<StrategyId>, ) -> PortfolioGreeksParamsBuilder<SetStrategyId<S>>
where S::StrategyId: IsUnset,

Optional (Some / Option setters). Strategy ID to filter positions by

Source

pub fn side( self, value: PositionSide, ) -> PortfolioGreeksParamsBuilder<SetSide<S>>
where S::Side: IsUnset,

Optional (Some / Option setters). Position side to filter by (default: NoPositionSide)

Source

pub fn maybe_side( self, value: Option<PositionSide>, ) -> PortfolioGreeksParamsBuilder<SetSide<S>>
where S::Side: IsUnset,

Optional (Some / Option setters). Position side to filter by (default: NoPositionSide)

Source

pub fn flat_interest_rate( self, value: f64, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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, ) -> PortfolioGreeksParamsBuilder<SetFlatDividendYield<S>>
where S::FlatDividendYield: IsUnset,

Optional (Some / Option setters). Flat dividend yield

Source

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

Optional (Some / Option setters). Flat dividend yield

Source

pub fn spot_shock( self, value: f64, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<SetPublishGreeks<S>>
where S::PublishGreeks: IsUnset,

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

Whether to publish greeks (default: false)

Source

pub fn percent_greeks( self, value: bool, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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>>, ) -> PortfolioGreeksParamsBuilder<SetBetaWeights<S>>
where S::BetaWeights: IsUnset,

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

Source

pub fn greeks_filter( self, value: GreeksFilterCallback, ) -> PortfolioGreeksParamsBuilder<SetGreeksFilter<S>>
where S::GreeksFilter: IsUnset,

Optional (Some / Option setters). Filter function for greeks

Source

pub fn maybe_greeks_filter( self, value: Option<GreeksFilterCallback>, ) -> PortfolioGreeksParamsBuilder<SetGreeksFilter<S>>
where S::GreeksFilter: IsUnset,

Optional (Some / Option setters). Filter function for greeks

Source

pub fn vega_time_weight_base( self, value: i32, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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>, ) -> PortfolioGreeksParamsBuilder<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>>, ) -> PortfolioGreeksParamsBuilder<SetVolBetaWeights<S>>
where S::VolBetaWeights: IsUnset,

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

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
§

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> 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