pub struct InstrumentGreeksParams {Show 15 fields
pub instrument_id: InstrumentId,
pub flat_interest_rate: f64,
pub flat_dividend_yield: Option<f64>,
pub spot_shock: f64,
pub vol_shock: f64,
pub time_to_expiry_shock: f64,
pub use_cached_greeks: bool,
pub cache_greeks: bool,
pub publish_greeks: bool,
pub ts_event: Option<UnixNanos>,
pub position: Option<Position>,
pub percent_greeks: bool,
pub index_instrument_id: Option<InstrumentId>,
pub beta_weights: Option<HashMap<InstrumentId, f64>>,
pub vega_time_weight_base: Option<i32>,
}
Expand description
Builder for instrument greeks calculation parameters.
Fields§
§instrument_id: InstrumentId
The instrument ID to calculate greeks for
flat_interest_rate: f64
Flat interest rate (default: 0.0425)
flat_dividend_yield: Option<f64>
Flat dividend yield
spot_shock: f64
Spot price shock (default: 0.0)
vol_shock: f64
Volatility shock (default: 0.0)
time_to_expiry_shock: f64
Time to expiry shock (default: 0.0)
use_cached_greeks: bool
Whether to use cached greeks (default: false)
cache_greeks: bool
Whether to cache greeks (default: false)
publish_greeks: bool
Whether to publish greeks (default: false)
ts_event: Option<UnixNanos>
Event timestamp
position: Option<Position>
Position for PnL calculation
percent_greeks: bool
Whether to compute percent greeks (default: false)
index_instrument_id: Option<InstrumentId>
Index instrument ID for beta weighting
beta_weights: Option<HashMap<InstrumentId, f64>>
Beta weights for portfolio calculations
vega_time_weight_base: Option<i32>
Base value in days for time-weighting vega
Implementations§
Source§impl InstrumentGreeksParams
impl InstrumentGreeksParams
Sourcepub fn calculate(&self, calculator: &GreeksCalculator) -> Result<GreeksData>
pub fn calculate(&self, calculator: &GreeksCalculator) -> Result<GreeksData>
Calculate instrument greeks using the builder parameters.
§Errors
Returns an error if the greeks calculation fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InstrumentGreeksParams
impl RefUnwindSafe for InstrumentGreeksParams
impl Send for InstrumentGreeksParams
impl Sync for InstrumentGreeksParams
impl Unpin for InstrumentGreeksParams
impl UnwindSafe for InstrumentGreeksParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more