Struct options_common::OptionsPosition [−][src]
pub struct OptionsPosition {}Show fields
pub symbol: String, pub underlying_symbol: String, 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 strike_price: Rational64, pub option_type: OptionType, pub expiration_date: ExpirationDate, 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.
is_long: bool
Whether the position is long or short the underlying.
unit_cost: Option<Rational64>
The original cost per option contract in this position. If the position is long, this should be negative.
unit_bid_price: Option<Rational64>
The current bid price per option contract in this position. If the position is long, this should be positive.
unit_ask_price: Option<Rational64>
The current ask price per option contract in this position. If the position is long, this should be positive.
unit_delta: Option<NotNan<f64>>
The delta per option contract in this position.
unit_vega: Option<NotNan<f64>>
The vega per option contract in this position.
unit_theta: Option<NotNan<f64>>
The theta per option contract in this position.
quantity: usize
The number of option contracts in this position.
strike_price: Rational64
The strike price of the option.
option_type: OptionType
The type of the option.
expiration_date: ExpirationDate
The expiration date of the option.
lot_size: Option<usize>
The number of units of the underlying per option contract in this position. Assumed to be 100 if not defined.
Implementations
Trait Implementations
Performs the conversion.
For an option position, the symbol of the option itself. For a share position, equal to Self::underlying_symbol()
.
For an option position, the symbol of the instrument that the option is a derivative of. For a share position, the symbol of the stock. Read more
The original cost per option contract or share in this position. If the position is long, this should be negative.
The current bid price per option contract or share in this position. If the position is long, this should be positive.
The current ask price per option contract or share in this position. If the position is long, this should be positive.
The delta per option contract or share in this position.
The vega per option contract or share in this position.
The theta per option contract in this position.
For an option position, the strike price of the option. For a share position, the strike price of the call option with the equivalent cost at the time of purchase i.e. $0. Read more
For an option position, the type of the option. For a share position, equal to OptionType::Call
.
For an option position, the number of units of the underlying per option contract. For a share position, equal to 1. Read more
Equal to Self::quantity()
, but negative if the position is short.
The total original cost of all option contracts or shares in this position.
The total current bid price for all option contracts or shares in this position.
The total current ask price for all option contracts or shares in this position.
The total current mid price for all option contracts or shares in this position.
The current mid price per option contract or share in this position. If the position is long, this will be positive.
The total delta for all option contracts or shares in this position.
The total vega for all option contracts or shares in this position.
The total theta for all option contracts or shares in this position.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for OptionsPosition
impl Send for OptionsPosition
impl Sync for OptionsPosition
impl Unpin for OptionsPosition
impl UnwindSafe for OptionsPosition
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
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) -> 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
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
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
pub fn vzip(self) -> V