Binance Connector JS
    Preparing search index...

    TradeApi - object-oriented interface TradeApi

    Implements

    Index

    Constructors

    Methods

    • Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue

      Weight(IP): 1

      Security Type: TRADE

      Notes:

      • Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent.
      • Both quantity and price must be sent
      • When the new quantity or price doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is.
      • However the order will be cancelled by the amendment in the following situations:
      • when the order is in partially filled status and the new quantity <= executedQty
      • When the order is GTX and the new price will cause it to be executed immediately

      Parameters

      Returns Promise<RestApiResponse<ModifyCmOrderResponse>>

      TradeApi

    • Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue

      Weight(IP): 1

      Security Type: TRADE

      Notes:

      • Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent.
      • Both quantity and price must be sent
      • When the new quantity or price doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is.
      • However the order will be cancelled by the amendment in the following situations:
      • when the order is in partially filled status and the new quantity <= executedQty
      • When the order is GTX and the new price will cause it to be executed immediately
      • The amendment keeps the order's original selfTradePreventionMode.

      Parameters

      Returns Promise<RestApiResponse<ModifyUmOrderResponse>>

      TradeApi

    • Place new UM conditional order

      Weight(IP): 1

      Security Type: TRADE

      Notes:

      • Algo order with type STOP, parameter timeInForce can be sent (default GTC).
      • Algo order with type TAKE_PROFIT, parameter timeInForce can be sent (default GTC).
      • Condition orders will be triggered when price reaches the triggerPrice.
      • STOP, STOP_MARKET: BUY: latest price >= triggerPrice; SELL: latest price <= triggerPrice.
      • TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: latest price <= triggerPrice; SELL: latest price >= triggerPrice.
      • TRAILING_STOP_MARKET: BUY: lowest price after order placed <= activatePrice, and latest price >= lowest price * (1 + callbackRate); SELL: highest price after order placed >= activatePrice, and latest price <= highest price * (1 - callbackRate).
      • STOP_MARKET, TAKE_PROFIT_MARKET with closePosition=true: follow the same rules for conditional orders; if triggered, close all current long position (if SELL) or current short position (if BUY); cannot be used with quantity parameter; cannot be used with reduceOnly parameter; in Hedge Mode, cannot be used with BUY orders in LONG position side, and cannot be used with SELL orders in SHORT position side.
      • selfTradePreventionMode is only effective when timeInForce set to IOC or GTC or GTD.

      Parameters

      Returns Promise<RestApiResponse<NewUmAlgoOrderResponse>>

      TradeApi