Struct options_common::OptionPosition[][src]

pub struct OptionPosition {
    pub symbol: String,
    pub underlying_symbol: String,
    pub option_type: OptionType,
    pub strike_price: Rational64,
    pub expiration_date: ExpirationDate,
    pub is_long: bool,
    pub unit_cost: Option<Rational64>,
    pub unit_bid_price: Option<Rational64>,
    pub unit_ask_price: Option<Rational64>,
    pub unit_delta: Option<NotNan<f64>>,
    pub quantity: usize,
    pub lot_size: Option<usize>,
}

Fields

symbol: String

The symbol of the option itself.

underlying_symbol: String

The symbol of the instrument that the option is a derivative of.

option_type: OptionTypestrike_price: Rational64expiration_date: ExpirationDateis_long: boolunit_cost: Option<Rational64>

The original cost per contract in this position. If the position is long, this should be negative.

unit_bid_price: Option<Rational64>

The current bid price per contract in this position. If the position is long, this should be positive.

unit_ask_price: Option<Rational64>

The current ask price per contract in this position. If the position is long, this should be positive.

unit_delta: Option<NotNan<f64>>

The delta per contract in this position.

quantity: usize

The number of contracts in this position.

lot_size: Option<usize>

The lot size per contract. Defaults to 100 if not defined.

Implementations

impl OptionPosition[src]

pub fn description(&self) -> String[src]

pub fn signed_quantity(&self) -> i64[src]

pub fn cost(&self) -> Option<Rational64>[src]

pub fn net_liq(&self) -> Option<Rational64>[src]

pub fn bid_price(&self) -> Option<Rational64>[src]

pub fn ask_price(&self) -> Option<Rational64>[src]

pub fn mid_price(&self) -> Option<Rational64>[src]

pub fn unit_mid_price(&self) -> Option<Rational64>[src]

pub fn delta(&self) -> Option<NotNan<f64>>[src]

pub fn profit_at_expiry(&self, underlying_price: Rational64) -> Rational64[src]

Trait Implementations

impl Clone for OptionPosition[src]

impl Debug for OptionPosition[src]

impl Eq for OptionPosition[src]

impl PartialEq<OptionPosition> for OptionPosition[src]

impl StructuralEq for OptionPosition[src]

impl StructuralPartialEq for OptionPosition[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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