Skip to main content

ProtoOaDeal

Struct ProtoOaDeal 

Source
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: i64

The unique ID of the execution deal.

§order_id: i64

Source order of the deal.

§position_id: i64

Source position of the deal.

§volume: i64

Volume sent for execution, in cents.

§filled_volume: i64

Filled volume, in cents.

§symbol_id: i64

The unique identifier of the symbol in specific server environment within cTrader platform. Different servers have different IDs.

§create_timestamp: i64

The Unix time in milliseconds when the deal was sent for execution.

§execution_timestamp: i64

The 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: i32

Buy/Sell.

§deal_status: i32

Status 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

Source

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.

Source

pub fn execution_price(&self) -> f64

Returns the value of execution_price, or the default value if execution_price is unset.

Source

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.

Source

pub fn set_trade_side(&mut self, value: ProtoOaTradeSide)

Sets trade_side to the provided enum value.

Source

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.

Source

pub fn set_deal_status(&mut self, value: ProtoOaDealStatus)

Sets deal_status to the provided enum value.

Source

pub fn margin_rate(&self) -> f64

Returns the value of margin_rate, or the default value if margin_rate is unset.

Source

pub fn commission(&self) -> i64

Returns the value of commission, or the default value if commission is unset.

Source

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.

Source

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

Source§

fn clone(&self) -> ProtoOaDeal

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProtoOaDeal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProtoOaDeal

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for ProtoOaDeal

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for ProtoOaDeal

Source§

fn eq(&self, other: &ProtoOaDeal) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ProtoOaDeal

Source§

impl StructuralPartialEq for ProtoOaDeal

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more