Struct fxoanda::CalculatedTradeState
source · pub struct CalculatedTradeState {
pub unrealized_pl: Option<f32>,
pub id: Option<String>,
pub margin_used: Option<f32>,
}
Fields§
§unrealized_pl: Option<f32>
The Trade’s unrealized profit/loss. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
id: Option<String>
The Trade’s ID. format: The string representation of the OANDA-assigned TradeID. OANDA- assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade.
margin_used: Option<f32>
Margin currently used by the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
Implementations§
source§impl CalculatedTradeState
impl CalculatedTradeState
pub fn new() -> CalculatedTradeState
sourcepub fn with_unrealized_pl(self, x: f32) -> CalculatedTradeState
pub fn with_unrealized_pl(self, x: f32) -> CalculatedTradeState
The Trade’s 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 CalculatedTradeState
sourcepub fn with_id(self, x: String) -> CalculatedTradeState
pub fn with_id(self, x: String) -> CalculatedTradeState
The Trade’s ID. format: The string representation of the OANDA-assigned TradeID. OANDA- assigned TradeIDs are positive integers, and are derived from the TransactionID of the Transaction that opened the Trade.
- param String
- return CalculatedTradeState
sourcepub fn with_margin_used(self, x: f32) -> CalculatedTradeState
pub fn with_margin_used(self, x: f32) -> CalculatedTradeState
Margin currently used by the Trade. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
- param f32
- return CalculatedTradeState