pub struct ProtoOaDeal {Show 17 fields
pub deal_id: i64,
pub order_id: i64,
pub position_id: i64,
pub volume: i64,
pub filled_volume: i64,
pub symbol_id: i64,
pub create_timestamp: i64,
pub execution_timestamp: i64,
pub utc_last_update_timestamp: Option<i64>,
pub execution_price: Option<f64>,
pub trade_side: i32,
pub deal_status: i32,
pub margin_rate: Option<f64>,
pub commission: Option<i64>,
pub base_to_usd_conversion_rate: Option<f64>,
pub close_position_detail: Option<ProtoOaClosePositionDetail>,
pub money_digits: Option<u32>,
}Expand description
- Execution entity.
Fields§
§deal_id: i64The unique ID of the execution deal.
order_id: i64Source order of the deal.
position_id: i64Source position of the deal.
volume: i64Volume sent for execution, in cents.
filled_volume: i64Filled volume, in cents.
symbol_id: i64The unique identifier of the symbol in specific server environment within cTrader platform. Different servers have different IDs.
create_timestamp: i64The Unix time in milliseconds when the deal was sent for execution.
execution_timestamp: i64The Unix time in milliseconds when the deal was executed.
utc_last_update_timestamp: Option<i64>The Unix time in milliseconds when the deal was created, executed or rejected.
execution_price: Option<f64>Execution price.
trade_side: i32Buy/Sell.
deal_status: i32Status of the deal.
margin_rate: Option<f64>Rate for used margin computation. Represented as Base/Deposit.
commission: Option<i64>Amount of trading commission associated with the deal.
base_to_usd_conversion_rate: Option<f64>Base to USD conversion rate on the time of deal execution.
close_position_detail: Option<ProtoOaClosePositionDetail>Closing position detail. Valid only for closing deal.
money_digits: Option<u32>Specifies the exponent of the monetary values. E.g. moneyDigits = 8 must be interpret as business value multiplied by 10^8, then real balance would be 10053099944 / 10^8 = 100.53099944. Affects commission.
Implementations§
Source§impl ProtoOaDeal
impl ProtoOaDeal
Sourcepub fn utc_last_update_timestamp(&self) -> i64
pub fn utc_last_update_timestamp(&self) -> i64
Returns the value of utc_last_update_timestamp, or the default value if utc_last_update_timestamp is unset.
Sourcepub fn execution_price(&self) -> f64
pub fn execution_price(&self) -> f64
Returns the value of execution_price, or the default value if execution_price is unset.
Sourcepub fn trade_side(&self) -> ProtoOaTradeSide
pub fn trade_side(&self) -> ProtoOaTradeSide
Returns the enum value of trade_side, or the default if the field is set to an invalid enum value.
Sourcepub fn set_trade_side(&mut self, value: ProtoOaTradeSide)
pub fn set_trade_side(&mut self, value: ProtoOaTradeSide)
Sets trade_side to the provided enum value.
Sourcepub fn deal_status(&self) -> ProtoOaDealStatus
pub fn deal_status(&self) -> ProtoOaDealStatus
Returns the enum value of deal_status, or the default if the field is set to an invalid enum value.
Sourcepub fn set_deal_status(&mut self, value: ProtoOaDealStatus)
pub fn set_deal_status(&mut self, value: ProtoOaDealStatus)
Sets deal_status to the provided enum value.
Sourcepub fn margin_rate(&self) -> f64
pub fn margin_rate(&self) -> f64
Returns the value of margin_rate, or the default value if margin_rate is unset.
Sourcepub fn commission(&self) -> i64
pub fn commission(&self) -> i64
Returns the value of commission, or the default value if commission is unset.
Sourcepub fn base_to_usd_conversion_rate(&self) -> f64
pub fn base_to_usd_conversion_rate(&self) -> f64
Returns the value of base_to_usd_conversion_rate, or the default value if base_to_usd_conversion_rate is unset.
Sourcepub fn money_digits(&self) -> u32
pub fn money_digits(&self) -> u32
Returns the value of money_digits, or the default value if money_digits is unset.
Trait Implementations§
Source§impl Clone for ProtoOaDeal
impl Clone for ProtoOaDeal
Source§fn clone(&self) -> ProtoOaDeal
fn clone(&self) -> ProtoOaDeal
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProtoOaDeal
impl Debug for ProtoOaDeal
Source§impl Default for ProtoOaDeal
impl Default for ProtoOaDeal
Source§impl<'de> Deserialize<'de> for ProtoOaDeal
impl<'de> Deserialize<'de> for ProtoOaDeal
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 Message for ProtoOaDeal
impl Message for ProtoOaDeal
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.