Skip to main content

Order

Struct Order 

Source
pub struct Order {
Show 45 fields pub order_id: String, pub order_link_id: Option<String>, pub block_trade_id: Option<String>, pub symbol: String, pub price: Decimal, pub qty: Decimal, pub side: Side, pub is_leverage: Option<bool>, pub position_idx: PositionIdx, pub order_status: OrderStatus, pub create_type: Option<CreateType>, pub cancel_type: CancelType, pub reject_reason: RejectReason, pub avg_price: Option<Decimal>, pub leaves_qty: Decimal, pub leaves_value: Decimal, pub cum_exec_qty: Decimal, pub cum_exec_value: Decimal, pub cum_exec_fee: Decimal, pub time_in_force: TimeInForce, pub order_type: OrderType, pub stop_order_type: Option<StopOrderType>, pub order_iv: Option<Decimal>, pub market_unit: Option<String>, pub trigger_price: Option<Decimal>, pub take_profit: Option<Decimal>, pub stop_loss: Option<Decimal>, pub tpsl_mode: Option<TpslMode>, pub oco_trigger_by: Option<OcoTriggerBy>, pub tp_limit_price: Option<Decimal>, pub sl_limit_price: Option<Decimal>, pub tp_trigger_by: Option<TriggerBy>, pub sl_trigger_by: Option<TriggerBy>, pub trigger_direction: TriggerDirection, pub trigger_by: Option<TriggerBy>, pub last_price_on_created: Option<Decimal>, pub base_price: Option<Decimal>, pub reduce_only: bool, pub close_on_trigger: bool, pub place_type: Option<PlaceType>, pub smp_type: SmpType, pub smp_group: i64, pub smp_order_id: Option<String>, pub created_time: Timestamp, pub updated_time: Timestamp,
}

Fields§

§order_id: String

Order ID

§order_link_id: Option<String>

User customized order ID

§block_trade_id: Option<String>

Paradigm block trade ID

§symbol: String

Symbol name

§price: Decimal

Order price

§qty: Decimal

Order qty

§side: Side

Side. Buy,Sell

§is_leverage: Option<bool>

Whether to borrow. Unified spot only. 0: false, 1: true. Classic spot is not supported, always 0

§position_idx: PositionIdx

Position index. Used to identify positions in different position modes.

§order_status: OrderStatus

Order status

§create_type: Option<CreateType>

Order create type Only for category=linear or inverse Spot, Option do not have this key

§cancel_type: CancelType

Cancel type

§reject_reason: RejectReason

Reject reason. Classic spot is not supported

§avg_price: Option<Decimal>

Average filled price UTA: returns “” for those orders without avg price classic account: returns “0” for those orders without avg price, and also for those orders have partially filled but cancelled at the end

§leaves_qty: Decimal

The remaining qty not executed. Classic spot is not supported

§leaves_value: Decimal

The estimated value not executed. Classic spot is not supported

§cum_exec_qty: Decimal

Cumulative executed order qty

§cum_exec_value: Decimal

Cumulative executed order value. Classic spot is not supported

§cum_exec_fee: Decimal

Cumulative executed trading fee. Classic spot is not supported

§time_in_force: TimeInForce

Time in force

§order_type: OrderType

Order type. Market,Limit. For TP/SL order, it means the order type after triggered

§stop_order_type: Option<StopOrderType>

Stop order type

§order_iv: Option<Decimal>

Implied volatility

§market_unit: Option<String>

The unit for qty when create Spot market orders for UTA account. baseCoin, quoteCoin

§trigger_price: Option<Decimal>

Trigger price. If stopOrderType=TrailingStop, it is activate price. Otherwise, it is trigger price

§take_profit: Option<Decimal>

Take profit price

§stop_loss: Option<Decimal>

Stop loss price

§tpsl_mode: Option<TpslMode>

TP/SL mode, Full: entire position for TP/SL. Partial: partial position tp/sl. Spot does not have this field, and Option returns always “”

§oco_trigger_by: Option<OcoTriggerBy>

The trigger type of Spot OCO order.OcoTriggerByUnknown, OcoTriggerByTp, OcoTriggerByBySl. Classic spot is not supported

§tp_limit_price: Option<Decimal>

The limit order price when take profit price is triggered

§sl_limit_price: Option<Decimal>

The limit order price when stop loss price is triggered

§tp_trigger_by: Option<TriggerBy>

The price type to trigger take profit

§sl_trigger_by: Option<TriggerBy>

The price type to trigger stop loss

§trigger_direction: TriggerDirection

Trigger direction. 1: rise, 2: fall

§trigger_by: Option<TriggerBy>

The price type of trigger price

§last_price_on_created: Option<Decimal>

Last price when place the order, Spot is not applicable

§base_price: Option<Decimal>

Last price when place the order, Spot has this field only

§reduce_only: bool

Reduce only. true means reduce position size

§close_on_trigger: bool

Close on trigger. What is a close on trigger order?

§place_type: Option<PlaceType>

Place type, option used. iv, price

§smp_type: SmpType

SMP execution type

§smp_group: i64

Smp group ID. If the UID has no group, it is 0 by default

§smp_order_id: Option<String>

The counterparty’s orderID which triggers this SMP execution

§created_time: Timestamp

Order created timestamp (ms)

§updated_time: Timestamp

Order updated timestamp (ms)

Implementations§

Source§

impl Order

Source

pub fn is_open_status(&self) -> bool

Source

pub fn is_closed_status(&self) -> bool

Source

pub fn update(&mut self, msg: OrderMsg)

Trait Implementations§

Source§

impl Clone for Order

Source§

fn clone(&self) -> Order

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 Order

Source§

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

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

impl<'de> Deserialize<'de> for Order

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 PartialEq for Order

Source§

fn eq(&self, other: &Order) -> 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 StructuralPartialEq for Order

Auto Trait Implementations§

§

impl Freeze for Order

§

impl RefUnwindSafe for Order

§

impl Send for Order

§

impl Sync for Order

§

impl Unpin for Order

§

impl UnsafeUnpin for Order

§

impl UnwindSafe for Order

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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