pub struct NewOCOOrder { /* private fields */ }
Expand description

POST /api/v3/order/oco

Send in a new OCO

  • Price Restrictions:
    • SELL: Limit Price > Last Price > Stop Price
    • BUY: Limit Price < Last Price < Stop Price
  • Quantity Restrictions:
    • Both legs must have the same quantity
    • ICEBERG quantities however do not have to be the same
  • Order Rate Limit
    • OCO counts as 2 orders against the order rate limit.

Weight(IP): 1

Example

use binance_spot_connector_rust::trade::{self, order::{Side, TimeInForce}};
use rust_decimal_macros::dec;

let request = trade::new_oco_order("BNBUSDT", Side::Sell, dec!(0.1), dec!(400.15), dec!(390.3)).stop_limit_price(dec!(380.3)).stop_limit_time_in_force(TimeInForce::Gtc);

Implementations§

source§

impl NewOCOOrder

source

pub fn new( symbol: &str, side: Side, quantity: Decimal, price: Decimal, stop_price: Decimal ) -> Self

source

pub fn list_client_order_id(self, list_client_order_id: &str) -> Self

source

pub fn limit_client_order_id(self, limit_client_order_id: &str) -> Self

source

pub fn limit_iceberg_qty(self, limit_iceberg_qty: Decimal) -> Self

source

pub fn trailing_delta(self, trailing_delta: Decimal) -> Self

source

pub fn stop_client_order_id(self, stop_client_order_id: &str) -> Self

source

pub fn stop_limit_price(self, stop_limit_price: Decimal) -> Self

source

pub fn stop_iceberg_qty(self, stop_iceberg_qty: Decimal) -> Self

source

pub fn stop_limit_time_in_force( self, stop_limit_time_in_force: TimeInForce ) -> Self

source

pub fn new_order_resp_type( self, new_order_resp_type: NewOrderResponseType ) -> Self

source

pub fn recv_window(self, recv_window: u64) -> Self

source

pub fn credentials(self, credentials: &Credentials) -> Self

Trait Implementations§

source§

impl From<NewOCOOrder> for Request

source§

fn from(request: NewOCOOrder) -> Request

Converts to this type from the input type.

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V