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

POST /api/v3/order

Send in a new order.

  • LIMIT_MAKER are LIMIT orders that will be rejected if they would immediately match and trade as a taker.
  • STOP_LOSS and TAKE_PROFIT will execute a MARKET order when the stopPrice is reached.
  • Any LIMIT or LIMIT_MAKER type order can be made an iceberg order by sending an icebergQty.
  • Any order with an icebergQty MUST have timeInForce set to GTC.
  • MARKET orders using quantity specifies how much a user wants to buy or sell based on the market price.
  • MARKET orders using quoteOrderQty 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 and quoteOrderQty.
  • MARKET orders using quoteOrderQty will not break LOT_SIZE filter rules; the order will execute a quantity that will have the notional value as close as possible to quoteOrderQty.
  • 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

source

pub fn new(symbol: &str, side: Side, type: &str) -> Self

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn iceberg_qty(self, iceberg_qty: Decimal) -> 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<NewOrder> for Request

source§

fn from(request: NewOrder) -> 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