pub struct PositionItem {
pub symbol: String,
pub symbol_id: u64,
pub open_quantity: f64,
pub current_market_value: Option<f64>,
pub current_price: Option<f64>,
pub average_entry_price: f64,
pub closed_pnl: Option<f64>,
pub open_pnl: Option<f64>,
pub total_cost: f64,
}Expand description
A single open position in a Questrade account.
Fields§
§symbol: StringTicker symbol.
symbol_id: u64Questrade internal symbol ID.
open_quantity: f64Number of shares or contracts currently held. Questrade may return
null for this field; it is deserialized as 0.0 in that case.
current_market_value: Option<f64>Current market value of the position.
current_price: Option<f64>Current market price per share or contract.
average_entry_price: f64Average cost basis per share or contract. Deserializes null as 0.0.
closed_pnl: Option<f64>Realized P&L on closed portions of the position.
open_pnl: Option<f64>Unrealized P&L on the remaining open position.
total_cost: f64Total cost basis for the position. Deserializes null as 0.0.
Trait Implementations§
Source§impl Clone for PositionItem
impl Clone for PositionItem
Source§fn clone(&self) -> PositionItem
fn clone(&self) -> PositionItem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PositionItem
impl Debug for PositionItem
Source§impl<'de> Deserialize<'de> for PositionItem
impl<'de> Deserialize<'de> for PositionItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PositionItem
impl RefUnwindSafe for PositionItem
impl Send for PositionItem
impl Sync for PositionItem
impl Unpin for PositionItem
impl UnsafeUnpin for PositionItem
impl UnwindSafe for PositionItem
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
Mutably borrows from an owned value. Read more