Struct binance_spot_connector_rust::trade::new_order::NewOrder
source · pub struct NewOrder { /* private fields */ }
Expand description
POST /api/v3/order
Send in a new order.
LIMIT_MAKER
areLIMIT
orders that will be rejected if they would immediately match and trade as a taker.STOP_LOSS
andTAKE_PROFIT
will execute aMARKET
order when thestopPrice
is reached.- Any
LIMIT
orLIMIT_MAKER
type order can be made an iceberg order by sending anicebergQty
. - Any order with an
icebergQty
MUST havetimeInForce
set toGTC
. MARKET
orders usingquantity
specifies how much a user wants to buy or sell based on the market price.MARKET
orders usingquoteOrderQty
specifies the amount the user wants to spend (when buying) or receive (when selling) of the quote asset; the correct quantity will be determined based on the market liquidity andquoteOrderQty
.MARKET
orders usingquoteOrderQty
will not breakLOT_SIZE
filter rules; the order will execute a quantity that will have the notional value as close as possible toquoteOrderQty
.- same
newClientOrderId
can be accepted only when the previous one is filled, otherwise the order will be rejected.
Trigger order price rules against market price for both MARKET
and LIMIT
versions:
- Price above market price:
STOP_LOSS
BUY
,TAKE_PROFIT
SELL
- Price below market price:
STOP_LOSS
SELL
,TAKE_PROFIT
BUY
Weight(IP): 1
Example
use binance_spot_connector_rust::trade::{ self, order::Side };
use rust_decimal_macros::dec;
let request = trade::new_order("BNBUSDT", Side::Sell, "MARKET")
.quantity(dec!(0.1));
Implementations§
source§impl NewOrder
impl NewOrder
pub fn new(symbol: &str, side: Side, type: &str) -> Self
pub fn time_in_force(self, time_in_force: TimeInForce) -> Self
pub fn quantity(self, quantity: Decimal) -> Self
pub fn quote_order_qty(self, quote_order_qty: Decimal) -> Self
pub fn price(self, price: Decimal) -> Self
pub fn new_client_order_id(self, new_client_order_id: &str) -> Self
pub fn stop_price(self, stop_price: Decimal) -> Self
pub fn trailing_delta(self, trailing_delta: u64) -> Self
pub fn iceberg_qty(self, iceberg_qty: Decimal) -> 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§
Auto Trait Implementations§
impl RefUnwindSafe for NewOrder
impl Send for NewOrder
impl Sync for NewOrder
impl Unpin for NewOrder
impl UnwindSafe for NewOrder
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