pub struct EquityForward {Show 16 fields
pub symbol: String,
pub currency: Option<String>,
pub exchange: Option<String>,
pub name: Option<String>,
pub cusip: Option<String>,
pub isin: Option<String>,
pub settlement_type: Option<String>,
pub underlying_price: Quote,
pub forward_price: Quote,
pub risk_free_rate: f64,
pub dividend_yield: f64,
pub borrow_cost: f64,
pub maturity_date: NaiveDate,
pub valuation_date: NaiveDate,
pub long_short: LongShort,
pub notional: f64,
}Expand description
A forward contract is an agreement between two parties to buy or sell, as the case may be, a commodity (or financial instrument or currency or any other underlying) on a pre-determined future date at a price agreed when the contract is entered into.
Fields§
§symbol: String§currency: Option<String>§exchange: Option<String>§name: Option<String>§cusip: Option<String>§isin: Option<String>§settlement_type: Option<String>§underlying_price: Quote§forward_price: Quote§risk_free_rate: f64§dividend_yield: f64§borrow_cost: f64Continuous stock borrow (repo) cost; part of the carry.
maturity_date: NaiveDate§valuation_date: NaiveDate§long_short: LongShort§notional: f64Implementations§
Source§impl EquityForward
impl EquityForward
Sourcepub fn from_json(data: &EquityForwardData) -> Box<Self>
pub fn from_json(data: &EquityForwardData) -> Box<Self>
Build from contract data, panicking on any invalid field. Fallible
callers should use EquityForward::try_from_json.
pub fn try_from_json( data: &EquityForwardData, ) -> Result<Box<Self>, RustyQLibError>
Source§impl EquityForward
impl EquityForward
Trait Implementations§
Source§impl Instrument for EquityForward
impl Instrument for EquityForward
Source§fn try_npv(&self) -> Result<f64, RustyQLibError>
fn try_npv(&self) -> Result<f64, RustyQLibError>
Present value, or a typed error when the instrument cannot be priced
(invalid inputs, or an engine/product combination the library
refuses to price).
Source§fn price(&self) -> Result<PricingResult, RustyQLibError>
fn price(&self) -> Result<PricingResult, RustyQLibError>
Price the instrument once, returning value, Greeks and (for Monte
Carlo engines) the standard error together in a
PricingResult. Read moreSource§fn npv(&self) -> f64
fn npv(&self) -> f64
Present value, panicking on any pricing error. Convenience for
instruments already known to be valid; fallible callers (batch
pricing, services) should use
Instrument::try_npv.Auto Trait Implementations§
impl Freeze for EquityForward
impl RefUnwindSafe for EquityForward
impl Send for EquityForward
impl Sync for EquityForward
impl Unpin for EquityForward
impl UnsafeUnpin for EquityForward
impl UnwindSafe for EquityForward
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