pub struct TradeRecord {Show 26 fields
pub close_price: Decimal,
pub close_time: Option<u64>,
pub close_time_string: Option<String>,
pub closed: bool,
pub cmd: TradingCommand,
pub comment: String,
pub commission: Option<Decimal>,
pub custom_comment: String,
pub digits: u32,
pub expiration: Option<u64>,
pub expiration_string: Option<String>,
pub margin_rate: Decimal,
pub offset: u32,
pub open_price: Decimal,
pub open_time: u64,
pub open_time_string: String,
pub order: u32,
pub order2: u32,
pub position: u32,
pub profit: Decimal,
pub sl: Decimal,
pub storage: Decimal,
pub symbol: Option<String>,
pub timestamp: u64,
pub tp: Decimal,
pub volume: Decimal,
}Expand description
Structure representing a trade order
Fields§
§close_price: DecimalClose price in base currency
close_time: Option<u64>Null if order is not closed
close_time_string: Option<String>Null if order is not closed
closed: boolClosed
cmd: TradingCommandOperation code
comment: StringComment
commission: Option<Decimal>Commission in account currency, null if not applicable
custom_comment: StringThe value the customer may provide in order to retrieve it later.
digits: u32Number of decimal places
expiration: Option<u64>Null if order is not closed
expiration_string: Option<String>Null if order is not closed
margin_rate: DecimalMargin rate
offset: u32Trailing offset
open_price: DecimalOpen price in base currency
open_time: u64Open time
open_time_string: StringOpen time string
order: u32Order number for opened transaction
order2: u32Order number for closed transaction
position: u32Order number common both for opened and closed transaction
profit: DecimalProfit in account currency
sl: DecimalZero if stop loss is not set (in base currency)
storage: DecimalOrder swaps in account currency
symbol: Option<String>Symbol name or null for deposit/withdrawal operations
timestamp: u64Timestamp
tp: DecimalZero if take profit is not set (in base currency)
volume: DecimalVolume in lots
Implementations§
Source§impl TradeRecord
impl TradeRecord
Sourcepub fn with_close_price(self, value: impl Into<Decimal>) -> Self
pub fn with_close_price(self, value: impl Into<Decimal>) -> Self
Sets the close_price field of this struct.
Sourcepub fn with_close_time(self, value: impl Into<u64>) -> Self
pub fn with_close_time(self, value: impl Into<u64>) -> Self
Sets the close_time field of this struct.
Sourcepub fn with_close_time_string(self, value: impl Into<String>) -> Self
pub fn with_close_time_string(self, value: impl Into<String>) -> Self
Sets the close_time_string field of this struct.
Sourcepub fn with_closed(self, value: impl Into<bool>) -> Self
pub fn with_closed(self, value: impl Into<bool>) -> Self
Sets the closed field of this struct.
Sourcepub fn with_cmd(self, value: impl Into<TradingCommand>) -> Self
pub fn with_cmd(self, value: impl Into<TradingCommand>) -> Self
Sets the cmd field of this struct.
Sourcepub fn with_comment(self, value: impl Into<String>) -> Self
pub fn with_comment(self, value: impl Into<String>) -> Self
Sets the comment field of this struct.
Sourcepub fn with_commission(self, value: impl Into<Decimal>) -> Self
pub fn with_commission(self, value: impl Into<Decimal>) -> Self
Sets the commission field of this struct.
Sourcepub fn with_custom_comment(self, value: impl Into<String>) -> Self
pub fn with_custom_comment(self, value: impl Into<String>) -> Self
Sets the custom_comment field of this struct.
Sourcepub fn with_digits(self, value: impl Into<u32>) -> Self
pub fn with_digits(self, value: impl Into<u32>) -> Self
Sets the digits field of this struct.
Sourcepub fn with_expiration(self, value: impl Into<u64>) -> Self
pub fn with_expiration(self, value: impl Into<u64>) -> Self
Sets the expiration field of this struct.
Sourcepub fn with_expiration_string(self, value: impl Into<String>) -> Self
pub fn with_expiration_string(self, value: impl Into<String>) -> Self
Sets the expiration_string field of this struct.
Sourcepub fn with_margin_rate(self, value: impl Into<Decimal>) -> Self
pub fn with_margin_rate(self, value: impl Into<Decimal>) -> Self
Sets the margin_rate field of this struct.
Sourcepub fn with_offset(self, value: impl Into<u32>) -> Self
pub fn with_offset(self, value: impl Into<u32>) -> Self
Sets the offset field of this struct.
Sourcepub fn with_open_price(self, value: impl Into<Decimal>) -> Self
pub fn with_open_price(self, value: impl Into<Decimal>) -> Self
Sets the open_price field of this struct.
Sourcepub fn with_open_time(self, value: impl Into<u64>) -> Self
pub fn with_open_time(self, value: impl Into<u64>) -> Self
Sets the open_time field of this struct.
Sourcepub fn with_open_time_string(self, value: impl Into<String>) -> Self
pub fn with_open_time_string(self, value: impl Into<String>) -> Self
Sets the open_time_string field of this struct.
Sourcepub fn with_order(self, value: impl Into<u32>) -> Self
pub fn with_order(self, value: impl Into<u32>) -> Self
Sets the order field of this struct.
Sourcepub fn with_order2(self, value: impl Into<u32>) -> Self
pub fn with_order2(self, value: impl Into<u32>) -> Self
Sets the order2 field of this struct.
Sourcepub fn with_position(self, value: impl Into<u32>) -> Self
pub fn with_position(self, value: impl Into<u32>) -> Self
Sets the position field of this struct.
Sourcepub fn with_profit(self, value: impl Into<Decimal>) -> Self
pub fn with_profit(self, value: impl Into<Decimal>) -> Self
Sets the profit field of this struct.
Sourcepub fn with_storage(self, value: impl Into<Decimal>) -> Self
pub fn with_storage(self, value: impl Into<Decimal>) -> Self
Sets the storage field of this struct.
Sourcepub fn with_symbol(self, value: impl Into<String>) -> Self
pub fn with_symbol(self, value: impl Into<String>) -> Self
Sets the symbol field of this struct.
Sourcepub fn with_timestamp(self, value: impl Into<u64>) -> Self
pub fn with_timestamp(self, value: impl Into<u64>) -> Self
Sets the timestamp field of this struct.
Sourcepub fn with_volume(self, value: impl Into<Decimal>) -> Self
pub fn with_volume(self, value: impl Into<Decimal>) -> Self
Sets the volume field of this struct.
Trait Implementations§
Source§impl Clone for TradeRecord
impl Clone for TradeRecord
Source§fn clone(&self) -> TradeRecord
fn clone(&self) -> TradeRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TradeRecord
impl Debug for TradeRecord
Source§impl Default for TradeRecord
impl Default for TradeRecord
Source§fn default() -> TradeRecord
fn default() -> TradeRecord
Source§impl<'de> Deserialize<'de> for TradeRecord
impl<'de> Deserialize<'de> for TradeRecord
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>,
Source§impl PartialEq for TradeRecord
impl PartialEq for TradeRecord
Source§impl Serialize for TradeRecord
impl Serialize for TradeRecord
impl StructuralPartialEq for TradeRecord
Auto Trait Implementations§
impl Freeze for TradeRecord
impl RefUnwindSafe for TradeRecord
impl Send for TradeRecord
impl Sync for TradeRecord
impl Unpin for TradeRecord
impl UnwindSafe for TradeRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)