Skip to main content

ProtoOaOrder

Struct ProtoOaOrder 

Source
pub struct ProtoOaOrder {
Show 23 fields pub order_id: i64, pub trade_data: ProtoOaTradeData, pub order_type: i32, pub order_status: i32, pub expiration_timestamp: Option<i64>, pub execution_price: Option<f64>, pub executed_volume: Option<i64>, pub utc_last_update_timestamp: Option<i64>, pub base_slippage_price: Option<f64>, pub slippage_in_points: Option<i64>, pub closing_order: Option<bool>, pub limit_price: Option<f64>, pub stop_price: Option<f64>, pub stop_loss: Option<f64>, pub take_profit: Option<f64>, pub client_order_id: Option<String>, pub time_in_force: Option<i32>, pub position_id: Option<i64>, pub relative_stop_loss: Option<i64>, pub relative_take_profit: Option<i64>, pub is_stop_out: Option<bool>, pub trailing_stop_loss: Option<bool>, pub stop_trigger_method: Option<i32>,
}
Expand description
  • Trade order entity.

Fields§

§order_id: i64

The unique ID of the order. Note: trader might have two orders with the same id if orders are taken from accounts from different brokers.

§trade_data: ProtoOaTradeData

Detailed trader data.

§order_type: i32

Order type.

§order_status: i32

Order status.

§expiration_timestamp: Option<i64>

The Unix time in milliseconds of expiration if the order has time in force GTD.

§execution_price: Option<f64>

Price at which an order was executed. For order with FILLED status.

§executed_volume: Option<i64>

Part of the volume that was filled in cents (e.g. 1000 in protocol means 10.00 units).

§utc_last_update_timestamp: Option<i64>

The Unix time in milliseconds of the last update of the order.

§base_slippage_price: Option<f64>

Used for Market Range order with combination of slippageInPoints to specify price range were order can be executed.

§slippage_in_points: Option<i64>

Used for Market Range and STOP_LIMIT orders to to specify price range were order can be executed.

§closing_order: Option<bool>

If TRUE then the order is closing part of whole position. Must have specified positionId.

§limit_price: Option<f64>

Valid only for LIMIT orders.

§stop_price: Option<f64>

Valid only for STOP and STOP_LIMIT orders.

§stop_loss: Option<f64>

Absolute stopLoss price.

§take_profit: Option<f64>

Absolute takeProfit price.

§client_order_id: Option<String>

Optional ClientOrderId. Max Length = 50 chars.

§time_in_force: Option<i32>

Order’s time in force. Depends on order type.

§position_id: Option<i64>

ID of the position linked to the order (e.g. closing order, order that increase volume of a specific position, etc.).

§relative_stop_loss: Option<i64>

Relative stopLoss that can be specified instead of absolute as one. Specified in 1/100000 of unit of a price. (e.g. 123000 in protocol means 1.23, 53423782 means 534.23782) For BUY stopLoss = entryPrice - relativeStopLoss, for SELL stopLoss = entryPrice + relativeStopLoss.

§relative_take_profit: Option<i64>

Relative takeProfit that can be specified instead of absolute one. Specified in 1/100000 of unit of a price. (e.g. 123000 in protocol means 1.23, 53423782 means 534.23782) ForBUY takeProfit = entryPrice + relativeTakeProfit, for SELL takeProfit = entryPrice - relativeTakeProfit.

§is_stop_out: Option<bool>

If TRUE then order was stopped out from server side.

§trailing_stop_loss: Option<bool>

If TRUE then order is trailingStopLoss. Valid for STOP_LOSS_TAKE_PROFIT order.

§stop_trigger_method: Option<i32>

Trigger method for the order. Valid only for STOP and STOP_LIMIT orders.

Implementations§

Source§

impl ProtoOaOrder

Source

pub fn order_type(&self) -> ProtoOaOrderType

Returns the enum value of order_type, or the default if the field is set to an invalid enum value.

Source

pub fn set_order_type(&mut self, value: ProtoOaOrderType)

Sets order_type to the provided enum value.

Source

pub fn order_status(&self) -> ProtoOaOrderStatus

Returns the enum value of order_status, or the default if the field is set to an invalid enum value.

Source

pub fn set_order_status(&mut self, value: ProtoOaOrderStatus)

Sets order_status to the provided enum value.

Source

pub fn expiration_timestamp(&self) -> i64

Returns the value of expiration_timestamp, or the default value if expiration_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 executed_volume(&self) -> i64

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

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 base_slippage_price(&self) -> f64

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

Source

pub fn slippage_in_points(&self) -> i64

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

Source

pub fn closing_order(&self) -> bool

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

Source

pub fn limit_price(&self) -> f64

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

Source

pub fn stop_price(&self) -> f64

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

Source

pub fn stop_loss(&self) -> f64

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

Source

pub fn take_profit(&self) -> f64

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

Source

pub fn client_order_id(&self) -> &str

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

Source

pub fn time_in_force(&self) -> ProtoOaTimeInForce

Returns the enum value of time_in_force, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_time_in_force(&mut self, value: ProtoOaTimeInForce)

Sets time_in_force to the provided enum value.

Source

pub fn position_id(&self) -> i64

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

Source

pub fn relative_stop_loss(&self) -> i64

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

Source

pub fn relative_take_profit(&self) -> i64

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

Source

pub fn is_stop_out(&self) -> bool

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

Source

pub fn trailing_stop_loss(&self) -> bool

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

Source

pub fn stop_trigger_method(&self) -> ProtoOaOrderTriggerMethod

Returns the enum value of stop_trigger_method, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_stop_trigger_method(&mut self, value: ProtoOaOrderTriggerMethod)

Sets stop_trigger_method to the provided enum value.

Trait Implementations§

Source§

impl Clone for ProtoOaOrder

Source§

fn clone(&self) -> ProtoOaOrder

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ProtoOaOrder

Source§

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

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

impl Default for ProtoOaOrder

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for ProtoOaOrder

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Message for ProtoOaOrder

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 ProtoOaOrder

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Serialize for ProtoOaOrder

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ProtoOaOrder

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,