Struct options_common::SharesPosition [−][src]
pub struct SharesPosition { pub symbol: String, pub is_long: bool, pub unit_cost: Option<Rational64>, pub unit_bid_price: Option<Rational64>, pub unit_ask_price: Option<Rational64>, pub quantity: usize, }
Fields
symbol: String
The symbol of the stock.
is_long: bool
Whether the position is long or short the underlying.
unit_cost: Option<Rational64>
The original cost per share in this position. If the position is long, this should be negative.
unit_bid_price: Option<Rational64>
The current bid price per share in this position. If the position is long, this should be positive.
unit_ask_price: Option<Rational64>
The current ask price per share in this position. If the position is long, this should be positive.
quantity: usize
The number of shares in this position.
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, where the delta equivalent of 1 share == 0.01.
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, where the delta equivalent of 1 share == 0.01.
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 SharesPosition
impl Send for SharesPosition
impl Sync for SharesPosition
impl Unpin for SharesPosition
impl UnwindSafe for SharesPosition
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