Skip to main content

EquityForward

Struct EquityForward 

Source
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: f64

Continuous stock borrow (repo) cost; part of the carry.

§maturity_date: NaiveDate§valuation_date: NaiveDate§long_short: LongShort§notional: f64

Implementations§

Source§

impl EquityForward

Source

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.

Source

pub fn try_from_json( data: &EquityForwardData, ) -> Result<Box<Self>, RustyQLibError>

Source§

impl EquityForward

Source

pub fn delta(&self) -> f64

Source

pub fn gamma(&self) -> f64

Source

pub fn vega(&self) -> f64

Source

pub fn theta(&self) -> f64

Source

pub fn rho(&self) -> f64

Source

pub fn vanna(&self) -> f64

Source

pub fn charm(&self) -> f64

Source

pub fn gamma_p(&self) -> f64

Source

pub fn zomma(&self) -> f64

Trait Implementations§

Source§

impl Instrument for EquityForward

Source§

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>

Price the instrument once, returning value, Greeks and (for Monte Carlo engines) the standard error together in a PricingResult. Read more
Source§

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§

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V