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: Rational64,
}

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: Rational64

The number of shares in this position.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

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

Whether the position is long or short the underlying.

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.

The number of option contracts or shares 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 !=.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

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

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

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

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.