Binance Connector JS
    Preparing search index...

    TradeApi - object-oriented interface TradeApi

    Implements

    Index

    Constructors

    Methods

    • New CM Conditional Order

      Order with type STOP/TAKE_PROFIT, parameter timeInForce can be sent ( default GTC). Condition orders will be triggered when: STOP, STOP_MARKET: BUY: "MARK_PRICE" >= stopPrice SELL: "MARK_PRICE" <= stopPrice TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: "MARK_PRICE" <= stopPrice SELL: "MARK_PRICE" >= stopPrice TRAILING_STOP_MARKET: BUY: the lowest mark price after order placed <= activationPrice, and the latest mark price >= the lowest mark price * (1 + callbackRate) SELL: the highest mark price after order placed >= activationPrice, and the latest mark price <= the highest mark price * (1 - callbackRate) For TRAILING_STOP_MARKET, if you got such error code. {"code": -2021, "msg": "Order would immediately trigger."} means that the parameters you send do not meet the following requirements: BUY: activationPrice should be smaller than latest mark price. SELL: activationPrice should be larger than latest mark price. Condition orders will be triggered when: If parameterpriceProtectis sent as true: when price reaches the stopPrice ,the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol "triggerProtect" of a symbol can be got from GET /fapi/v1/exchangeInfo STOP, STOP_MARKET: BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice

      Weight: 1

      Parameters

      Returns Promise<RestApiResponse<NewCmConditionalOrderResponse>>

      TradeApi

    • Place new UM conditional order

      Order with type STOP/TAKE_PROFIT, parameter timeInForce can be sent ( default GTC). Condition orders will be triggered when: STOP, STOP_MARKET: BUY: "MARK_PRICE" >= stopPrice SELL: "MARK_PRICE" <= stopPrice TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: "MARK_PRICE" <= stopPrice SELL: "MARK_PRICE" >= stopPrice TRAILING_STOP_MARKET: BUY: the lowest mark price after order placed <= activationPrice, and the latest mark price >= the lowest mark price * (1 + callbackRate) SELL: the highest mark price after order placed >= activationPrice, and the latest mark price <= the highest mark price * (1 - callbackRate) For TRAILING_STOP_MARKET, if you got such error code. {"code": -2021, "msg": "Order would immediately trigger."} means that the parameters you send do not meet the following requirements: BUY: activationPrice should be smaller than latest mark price. SELL: activationPrice should be larger than latest mark price. Condition orders will be triggered when: If parameterpriceProtectis sent as true: when price reaches the stopPrice ,the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol "triggerProtect" of a symbol can be got from GET /fapi/v1/exchangeInfo STOP, STOP_MARKET: BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice selfTradePreventionMode is only effective when timeInForce set to IOC or GTC or GTD. In extreme market conditions, timeInForce GTD order auto cancel time might be delayed comparing to goodTillDate

      Weight: 1

      Parameters

      Returns Promise<RestApiResponse<NewUmConditionalOrderResponse>>

      TradeApi