Struct fxoanda::CalculatedPositionState
source · pub struct CalculatedPositionState {
pub short_unrealized_pl: Option<f32>,
pub instrument: Option<String>,
pub margin_used: Option<f32>,
pub net_unrealized_pl: Option<f32>,
pub long_unrealized_pl: Option<f32>,
}
Fields§
§short_unrealized_pl: Option<f32>
The unrealized profit/loss of the Position’s short open Trades format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
instrument: Option<String>
The Position’s Instrument. format: A string containing the base currency and quote currency delimited by a “_”.
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.
net_unrealized_pl: Option<f32>
The Position’s net unrealized profit/loss format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
long_unrealized_pl: Option<f32>
The unrealized profit/loss of the Position’s long open Trades format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
Implementations§
source§impl CalculatedPositionState
impl CalculatedPositionState
pub fn new() -> CalculatedPositionState
sourcepub fn with_short_unrealized_pl(self, x: f32) -> CalculatedPositionState
pub fn with_short_unrealized_pl(self, x: f32) -> CalculatedPositionState
The unrealized profit/loss of the Position’s short open Trades format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
- param f32
- return CalculatedPositionState
sourcepub fn with_instrument(self, x: String) -> CalculatedPositionState
pub fn with_instrument(self, x: String) -> CalculatedPositionState
The Position’s Instrument. format: A string containing the base currency and quote currency delimited by a “_”.
- param String
- return CalculatedPositionState
sourcepub fn with_margin_used(self, x: f32) -> CalculatedPositionState
pub fn with_margin_used(self, x: f32) -> CalculatedPositionState
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 CalculatedPositionState
sourcepub fn with_net_unrealized_pl(self, x: f32) -> CalculatedPositionState
pub fn with_net_unrealized_pl(self, x: f32) -> CalculatedPositionState
The Position’s net unrealized profit/loss format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
- param f32
- return CalculatedPositionState
sourcepub fn with_long_unrealized_pl(self, x: f32) -> CalculatedPositionState
pub fn with_long_unrealized_pl(self, x: f32) -> CalculatedPositionState
The unrealized profit/loss of the Position’s long open Trades format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
- param f32
- return CalculatedPositionState