Binance Connector JS
    Preparing search index...

    TradeApi - interface TradeApi

    interface TradeApiInterface {
        deleteOpenOrders(
            requestParameters: DeleteOpenOrdersRequest,
        ): Promise<RestApiResponse<DeleteOpenOrdersResponse>>;
        deleteOrder(
            requestParameters: DeleteOrderRequest,
        ): Promise<RestApiResponse<DeleteOrderResponse>>;
        deleteOrderList(
            requestParameters: DeleteOrderListRequest,
        ): Promise<RestApiResponse<DeleteOrderListResponse>>;
        newOrder(
            requestParameters: SpotRestAPI.NewOrderRequest,
        ): Promise<RestApiResponse<SpotRestAPI.NewOrderResponse>>;
        orderAmendKeepPriority(
            requestParameters: SpotRestAPI.OrderAmendKeepPriorityRequest,
        ): Promise<RestApiResponse<SpotRestAPI.OrderAmendKeepPriorityResponse>>;
        orderCancelReplace(
            requestParameters: SpotRestAPI.OrderCancelReplaceRequest,
        ): Promise<RestApiResponse<SpotRestAPI.OrderCancelReplaceResponse>>;
        orderListOco(
            requestParameters: OrderListOcoRequest,
        ): Promise<RestApiResponse<OrderListOcoResponse>>;
        orderListOto(
            requestParameters: OrderListOtoRequest,
        ): Promise<RestApiResponse<OrderListOtoResponse>>;
        orderListOtoco(
            requestParameters: OrderListOtocoRequest,
        ): Promise<RestApiResponse<OrderListOtocoResponse>>;
        orderOco(
            requestParameters: OrderOcoRequest,
        ): Promise<RestApiResponse<OrderOcoResponse>>;
        orderTest(
            requestParameters?: SpotRestAPI.OrderTestRequest,
        ): Promise<RestApiResponse<SpotRestAPI.OrderTestResponse>>;
        sorOrder(
            requestParameters: SorOrderRequest,
        ): Promise<RestApiResponse<SorOrderResponse>>;
        sorOrderTest(
            requestParameters?: SpotRestAPI.SorOrderTestRequest,
        ): Promise<RestApiResponse<SpotRestAPI.SorOrderTestResponse>>;
    }

    Implemented by

    Index

    Methods

    • Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other.

      An OCO has 2 orders called the above order and below order. One of the orders must be a LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT order and the other must be STOP_LOSS or STOP_LOSS_LIMIT order. Price restrictions If the OCO is on the SELL side: LIMIT_MAKER/TAKE_PROFIT_LIMIT price > Last Traded Price > STOP_LOSS/STOP_LOSS_LIMIT stopPrice TAKE_PROFIT stopPrice > Last Traded Price > STOP_LOSS/STOP_LOSS_LIMIT stopPrice If the OCO is on the BUY side: LIMIT_MAKER/TAKE_PROFIT_LIMIT price < Last Traded Price < stopPrice TAKE_PROFIT stopPrice < Last Traded Price < STOP_LOSS/STOP_LOSS_LIMIT stopPrice OCOs add 2 orders to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter. Weight: 1

      Unfilled Order Count: 2

      Parameters

      Returns Promise<RestApiResponse<OrderListOcoResponse>>

      TradeApiInterface

    • Place an OTO.

      An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders. The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the working order goes on the order book. The second order is called the pending order. It can be any order type except for MARKET orders using parameter quoteOrderQty. The pending order is only placed on the order book when the working order gets fully filled. If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired. When the order list is placed, if the working order gets immediately fully filled, the placement response will show the working order as FILLED but the pending order will still appear as PENDING_NEW. You need to query the status of the pending order again to see its updated status. OTOs add 2 orders to the EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter. Weight: 1

      Unfilled Order Count: 2

      Parameters

      Returns Promise<RestApiResponse<OrderListOtoResponse>>

      TradeApiInterface

    • Place an OTOCO.

      An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders. The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the working order goes on the order book. The behavior of the working order is the same as the OTO. OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The pending orders are only placed on the order book when the working order gets fully filled. The rules of the pending above and pending below follow the same rules as the Order list OCO. OTOCOs add 3 orders to the EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter. Weight: 1

      Unfilled Order Count: 3

      Parameters

      Returns Promise<RestApiResponse<OrderListOtocoResponse>>

      TradeApiInterface

    • 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 OCO adds 2 orders to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter. Weight: 1

      Unfilled Order Count: 2

      Parameters

      Returns Promise<RestApiResponse<OrderOcoResponse>>

      TradeApiInterface