Struct options_common::OptionPosition[][src]

pub struct OptionPosition {
Show fields 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 unit_vega: Option<NotNan<f64>>, pub unit_theta: Option<NotNan<f64>>, pub quantity: usize, pub lot_size: Option<usize>,
}

Fields

symbol: String
Expand description

The symbol of the option itself.

underlying_symbol: String
Expand description

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

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

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

unit_bid_price: Option<Rational64>
Expand description

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

unit_ask_price: Option<Rational64>
Expand description

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

unit_delta: Option<NotNan<f64>>
Expand description

The delta per contract in this position.

unit_vega: Option<NotNan<f64>>
Expand description

The vega per contract in this position.

unit_theta: Option<NotNan<f64>>
Expand description

The theta per contract in this position.

quantity: usize
Expand description

The number of contracts in this position.

lot_size: Option<usize>
Expand description

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 vega(&self) -> Option<NotNan<f64>>[src]

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

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

Trait Implementations

impl Clone for OptionPosition[src]

fn clone(&self) -> OptionPosition[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for OptionPosition[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl PartialEq<OptionPosition> for OptionPosition[src]

fn eq(&self, other: &OptionPosition) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &OptionPosition) -> bool[src]

This method tests for !=.

impl Eq 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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

pub fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

pub fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).

pub unsafe fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

pub fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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

pub fn vzip(self) -> V