Struct options_common::OptionPosition [−][src]
#[non_exhaustive]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 (Non-exhaustive)
This struct is marked as non-exhaustive
Struct {{ .. }} syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.symbol: StringExpand description
The symbol of the option itself.
underlying_symbol: StringExpand 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: usizeExpand 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]
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]
impl Clone for OptionPosition[src]fn clone(&self) -> 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]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for OptionPosition[src]
impl Debug for OptionPosition[src]impl PartialEq<OptionPosition> for OptionPosition[src]
impl PartialEq<OptionPosition> for OptionPosition[src]fn eq(&self, other: &OptionPosition) -> bool[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]
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
impl RefUnwindSafe for OptionPosition
impl Send for OptionPosition
impl Sync for OptionPosition
impl Unpin for OptionPosition
impl UnwindSafe for OptionPosition
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>, pub fn to_subset(&self) -> Option<SS>
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
pub fn is_in_subset(&self) -> boolChecks if self is actually part of its subset T (and can be converted to it).
pub unsafe fn to_subset_unchecked(&self) -> SS
pub unsafe fn to_subset_unchecked(&self) -> SSUse with care! Same as self.to_subset but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SPThe inclusion map: converts self to the equivalent element of its superset.
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
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]
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<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,