Struct Trade
pub struct Trade {
pub id: String,
pub instrument: AnyInstrument,
pub quantity: f64,
}Expand description
A booked position: an instrument, how much of it, and what to call it.
Fields§
§id: StringThe trade’s identifier.
instrument: AnyInstrumentWhat was traded.
quantity: f64How many. Negative is a sold position.
Implementations§
Trait Implementations§
§impl<R: Scalar> Priceable<R> for Trade
impl<R: Scalar> Priceable<R> for Trade
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
Present value against the resolved market view. Read more
§fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The par rate — the fixed rate at which the product is worth nothing. Read more
§fn par_spread(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The par (breakeven) floating-leg spread. Zero for a product with no
floating leg. Read more
§impl PricingRiskFactors for Trade
impl PricingRiskFactors for Trade
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
The market data this product is priced against. Read more
impl StructuralPartialEq for Trade
Auto Trait Implementations§
impl !RefUnwindSafe for Trade
impl !UnwindSafe for Trade
impl Freeze for Trade
impl Send for Trade
impl Sync for Trade
impl Unpin for Trade
impl UnsafeUnpin for Trade
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