#[non_exhaustive]pub struct Position {
pub symbol: String,
pub quantity: f64,
pub average_price: f64,
pub unrealized_pnl: Option<f64>,
pub last_price: Option<f64>,
pub trade_value: Option<f64>,
pub market_value: Option<f64>,
pub leverage: Option<f64>,
pub margin: Option<f64>,
pub expiration: Option<DateTime<Utc>>,
}Expand description
The net position in one symbol.
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: StringThe symbol as the feed knows it.
quantity: f64In the symbol’s trading units, positive when long, negative when short. 0 means flat and removes the position.
average_price: f64The average price the open quantity was entered at, in the symbol’s price units.
unrealized_pnl: Option<f64>The profit or loss at the current price in the account’s currency, when the broker reports it.
last_price: Option<f64>The price the position is valued at, when the broker reports it.
trade_value: Option<f64>The open quantity at its average price in the account’s currency, when the broker reports it.
market_value: Option<f64>The open quantity at the last price in the account’s currency, when the broker reports it.
leverage: Option<f64>How many times the margin the position’s market value is, such as 100 for 100:1, when the broker reports it.
margin: Option<f64>The margin the position holds in the account’s currency, when the broker reports it.
expiration: Option<DateTime<Utc>>When the instrument expires, for futures and options.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more