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 PriceBUY
: 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
impl NewOCOOrder
pub fn new( symbol: &str, side: Side, quantity: Decimal, price: Decimal, stop_price: Decimal ) -> Self
pub fn list_client_order_id(self, list_client_order_id: &str) -> Self
pub fn limit_client_order_id(self, limit_client_order_id: &str) -> Self
pub fn limit_iceberg_qty(self, limit_iceberg_qty: Decimal) -> Self
pub fn trailing_delta(self, trailing_delta: Decimal) -> Self
pub fn stop_client_order_id(self, stop_client_order_id: &str) -> Self
pub fn stop_limit_price(self, stop_limit_price: Decimal) -> Self
pub fn stop_iceberg_qty(self, stop_iceberg_qty: Decimal) -> Self
pub fn stop_limit_time_in_force( self, stop_limit_time_in_force: TimeInForce ) -> Self
pub fn new_order_resp_type( self, new_order_resp_type: NewOrderResponseType ) -> Self
pub fn recv_window(self, recv_window: u64) -> Self
pub fn credentials(self, credentials: &Credentials) -> Self
Trait Implementations§
source§impl From<NewOCOOrder> for Request
impl From<NewOCOOrder> for Request
source§fn from(request: NewOCOOrder) -> Request
fn from(request: NewOCOOrder) -> Request
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for NewOCOOrder
impl Send for NewOCOOrder
impl Sync for NewOCOOrder
impl Unpin for NewOCOOrder
impl UnwindSafe for NewOCOOrder
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