pub struct OptionsPosition {Show 14 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: Rational64,
pub strike_price: Rational64,
pub option_type: OptionType,
pub expiration_date: ExpirationDate,
pub lot_size: Option<i64>,
}Fields§
§symbol: StringThe symbol of the option itself.
underlying_symbol: StringThe symbol of the instrument that the option is a derivative of.
is_long: boolWhether 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, where the delta equivalent of 1 share == 0.01.
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: Rational64The number of option contracts in this position.
strike_price: Rational64The strike price of the option.
option_type: OptionTypeThe type of the option.
expiration_date: ExpirationDateThe expiration date of the option.
lot_size: Option<i64>The number of units of the underlying per option contract in this position. Assumed to be 100 if not defined.
Implementations§
Source§impl OptionsPosition
impl OptionsPosition
pub fn description(&self) -> String
Trait Implementations§
Source§impl Clone for OptionsPosition
impl Clone for OptionsPosition
Source§fn clone(&self) -> OptionsPosition
fn clone(&self) -> OptionsPosition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OptionsPosition
impl Debug for OptionsPosition
impl Eq for OptionsPosition
Source§impl From<OptionsPosition> for Position
impl From<OptionsPosition> for Position
Source§fn from(v: OptionsPosition) -> Position
fn from(v: OptionsPosition) -> Position
Source§impl GenericPosition for OptionsPosition
impl GenericPosition for OptionsPosition
Source§fn symbol(&self) -> &str
fn symbol(&self) -> &str
Self::underlying_symbol().Source§fn underlying_symbol(&self) -> &str
fn underlying_symbol(&self) -> &str
Source§fn unit_cost(&self) -> Option<Rational64>
fn unit_cost(&self) -> Option<Rational64>
fn unit_cost_mut(&mut self) -> &mut Option<Rational64>
Source§fn unit_bid_price(&self) -> Option<Rational64>
fn unit_bid_price(&self) -> Option<Rational64>
fn unit_bid_price_mut(&mut self) -> &mut Option<Rational64>
Source§fn unit_ask_price(&self) -> Option<Rational64>
fn unit_ask_price(&self) -> Option<Rational64>
fn unit_ask_price_mut(&mut self) -> &mut Option<Rational64>
Source§fn unit_delta(&self) -> Option<NotNan<f64>>
fn unit_delta(&self) -> Option<NotNan<f64>>
Source§fn unit_vega(&self) -> Option<NotNan<f64>>
fn unit_vega(&self) -> Option<NotNan<f64>>
Source§fn quantity(&self) -> Rational64
fn quantity(&self) -> Rational64
fn quantity_mut(&mut self) -> &mut Rational64
Source§fn equivalent_strike_price(&self) -> Rational64
fn equivalent_strike_price(&self) -> Rational64
Source§fn equivalent_option_type(&self) -> OptionType
fn equivalent_option_type(&self) -> OptionType
OptionType::Call.Source§fn equivalent_lot_size(&self) -> i64
fn equivalent_lot_size(&self) -> i64
Source§fn signed_quantity(&self) -> Rational64
fn signed_quantity(&self) -> Rational64
Self::quantity(), but negative if the position is short.