Struct fxoanda_definitions::Position
source · pub struct Position {
pub financing: Option<f32>,
pub short: Option<PositionSide>,
pub margin_used: Option<f32>,
pub unrealized_pl: Option<f32>,
pub commission: Option<f32>,
pub long: Option<PositionSide>,
pub instrument: Option<String>,
pub resettable_pl: Option<f32>,
pub guaranteed_execution_fees: Option<f32>,
pub pl: Option<f32>,
}
Fields§
§financing: Option<f32>
The total amount of financing paid/collected for this instrument over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
short: Option<PositionSide>
The representation of a Position for a single direction (long or short).
margin_used: Option<f32>
Margin currently used by the Position. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
unrealized_pl: Option<f32>
The unrealized profit/loss of all open Trades that contribute to this Position. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
commission: Option<f32>
The total amount of commission paid for this instrument over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
long: Option<PositionSide>
The representation of a Position for a single direction (long or short).
instrument: Option<String>
The Position’s Instrument. format: A string containing the base currency and quote currency delimited by a “_”.
resettable_pl: Option<f32>
Profit/loss realized by the Position since the Account’s resettablePL was last reset by the client. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
guaranteed_execution_fees: Option<f32>
The total amount of fees charged over the lifetime of the Account for the execution of guaranteed Stop Loss Orders for this instrument. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
pl: Option<f32>
Profit/loss realized by the Position over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
Implementations§
source§impl Position
impl Position
pub fn new() -> Position
sourcepub fn with_financing(self, x: f32) -> Self
pub fn with_financing(self, x: f32) -> Self
The total amount of financing paid/collected for this instrument over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
- param f32
- return Position
sourcepub fn with_short(self, x: PositionSide) -> Self
pub fn with_short(self, x: PositionSide) -> Self
The representation of a Position for a single direction (long or short).
- param PositionSide
- return Position
sourcepub fn with_margin_used(self, x: f32) -> Self
pub fn with_margin_used(self, x: f32) -> Self
Margin currently used by the Position. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
- param f32
- return Position
sourcepub fn with_unrealized_pl(self, x: f32) -> Self
pub fn with_unrealized_pl(self, x: f32) -> Self
The unrealized profit/loss of all open Trades that contribute to this Position. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
- param f32
- return Position
sourcepub fn with_commission(self, x: f32) -> Self
pub fn with_commission(self, x: f32) -> Self
The total amount of commission paid for this instrument over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
- param f32
- return Position
sourcepub fn with_long(self, x: PositionSide) -> Self
pub fn with_long(self, x: PositionSide) -> Self
The representation of a Position for a single direction (long or short).
- param PositionSide
- return Position
sourcepub fn with_instrument(self, x: String) -> Self
pub fn with_instrument(self, x: String) -> Self
The Position’s Instrument. format: A string containing the base currency and quote currency delimited by a “_”.
- param String
- return Position
sourcepub fn with_resettable_pl(self, x: f32) -> Self
pub fn with_resettable_pl(self, x: f32) -> Self
Profit/loss realized by the Position since the Account’s resettablePL was last reset by the client. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
- param f32
- return Position
sourcepub fn with_guaranteed_execution_fees(self, x: f32) -> Self
pub fn with_guaranteed_execution_fees(self, x: f32) -> Self
The total amount of fees charged over the lifetime of the Account for the execution of guaranteed Stop Loss Orders for this instrument. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
- param f32
- return Position