pub struct OcoOrder {
pub info: Option<Value>,
pub order_list_id: i64,
pub list_client_order_id: Option<String>,
pub symbol: String,
pub list_status: String,
pub list_order_status: String,
pub transaction_time: i64,
pub datetime: String,
pub orders: Vec<OcoOrderInfo>,
pub order_reports: Option<Vec<OrderReport>>,
}Expand description
OCO (One-Cancels-the-Other) order.
An OCO order is a combination order containing two orders:
- A limit order (take profit)
- A stop limit order (stop loss)
When one order is filled, the other is automatically cancelled.
Fields§
§info: Option<Value>Raw exchange response info.
order_list_id: i64OCO order list ID.
list_client_order_id: Option<String>Client order list ID.
symbol: StringTrading pair symbol.
list_status: StringOrder list status.
list_order_status: StringOrder list order status.
transaction_time: i64Transaction timestamp in milliseconds.
datetime: StringDatetime in ISO 8601 format.
orders: Vec<OcoOrderInfo>List of order info contained in the OCO order.
order_reports: Option<Vec<OrderReport>>Order reports (optional, returned when creating order).
Implementations§
Source§impl OcoOrder
impl OcoOrder
Sourcepub fn new(
order_list_id: i64,
symbol: String,
list_status: String,
list_order_status: String,
transaction_time: i64,
datetime: String,
orders: Vec<OcoOrderInfo>,
) -> OcoOrder
pub fn new( order_list_id: i64, symbol: String, list_status: String, list_order_status: String, transaction_time: i64, datetime: String, orders: Vec<OcoOrderInfo>, ) -> OcoOrder
Creates a new OCO order.
Sourcepub fn is_executing(&self) -> bool
pub fn is_executing(&self) -> bool
Checks if the OCO order is executing.
Sourcepub fn is_all_done(&self) -> bool
pub fn is_all_done(&self) -> bool
Checks if the OCO order is all done.
Sourcepub fn is_rejected(&self) -> bool
pub fn is_rejected(&self) -> bool
Checks if the OCO order is rejected.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OcoOrder
impl<'de> Deserialize<'de> for OcoOrder
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OcoOrder, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OcoOrder, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for OcoOrder
impl Serialize for OcoOrder
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for OcoOrder
impl RefUnwindSafe for OcoOrder
impl Send for OcoOrder
impl Sync for OcoOrder
impl Unpin for OcoOrder
impl UnwindSafe for OcoOrder
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
Mutably borrows from an owned value. Read more