#[non_exhaustive]pub struct Position {Show 17 fields
pub id: PositionId,
pub symbol: SymbolId,
pub side: TradeSide,
pub volume: Volume,
pub status: PositionStatus,
pub price: Option<Price>,
pub stop_loss: Option<Price>,
pub take_profit: Option<Price>,
pub swap: Decimal,
pub commission: Option<Decimal>,
pub used_margin: Option<Decimal>,
pub label: Option<String>,
pub comment: Option<String>,
pub guaranteed_stop_loss: bool,
pub trailing_stop_loss: bool,
pub opened: Option<Timestamp>,
pub updated: Option<Timestamp>,
}Expand description
Position as the server knows it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: PositionIdIdentifier of the position.
symbol: SymbolIdSymbol the position is in.
side: TradeSideDirection of the position.
volume: VolumeVolume of the position, in units of the symbol.
status: PositionStatusState of the position.
price: Option<Price>Price the position was opened at, averaged over its deals.
stop_loss: Option<Price>Stop loss as a price.
take_profit: Option<Price>Take profit as a price.
swap: DecimalSwap charged to the position so far, in the deposit currency.
commission: Option<Decimal>Commission charged to the position so far, in the deposit currency.
used_margin: Option<Decimal>Margin the position holds, in the deposit currency.
label: Option<String>Label of the order that opened the position.
comment: Option<String>Comment of the order that opened the position.
guaranteed_stop_loss: boolTells whether the stop loss is guaranteed.
trailing_stop_loss: boolTells whether the stop loss follows the price.
opened: Option<Timestamp>Moment the position was opened.
updated: Option<Timestamp>Moment the position last changed.
Trait Implementations§
impl Eq for Position
impl StructuralPartialEq for Position
Source§impl TryFrom<ProtoOaPosition> for Position
impl TryFrom<ProtoOaPosition> for Position
Source§type Error = ValueError
type Error = ValueError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Forget for Position
impl Freeze for Position
impl Move 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
Mutably borrows from an owned value. Read more