Binance.FuturesAlgo (binance v2.0.1)

Summary

Functions

Query Historical Algo Orders (USER_DATA)

Query Current Algo Open Orders (USER_DATA)

Query Sub Orders (USER_DATA)

Functions

Link to this function

delete_algo_futures_order(algoId, opts \\ [])

@spec delete_algo_futures_order(any(), recvWindow: any(), timestamp: any()) ::
  {:ok, any()} | {:error, any()}

Cancel Algo Order (TRADE)

Cancel an active order.

Weight(IP): 1

Details:

  • METHOD: delete
  • URL: /sapi/v1/algo/futures/order

Mandatory params:

  • algoId -

Optional params:

  • timestamp - timestamp
  • recvWindow - The value cannot be greater than 60000
Link to this function

get_algo_futures_historical_orders(opts \\ [])

@spec get_algo_futures_historical_orders(
  recvWindow: any(),
  pageSize: any(),
  page: any(),
  endTime: any(),
  startTime: any(),
  side: any(),
  symbol: any(),
  timestamp: any()
) :: {:ok, any()} | {:error, any()}

Query Historical Algo Orders (USER_DATA)

Weight(IP): 1

Details:

  • METHOD: get
  • URL: /sapi/v1/algo/futures/historicalOrders

Mandatory params:

Optional params:

  • timestamp - timestamp
  • symbol - Trading symbol eg. BTCUSDT
  • side - BUY or SELL
  • startTime - UTC timestamp in ms
  • endTime - UTC timestamp in ms
  • page - Default is 1
  • pageSize - MIN 1, MAX 100; Default 100
  • recvWindow - The value cannot be greater than 60000
Link to this function

get_algo_futures_open_orders(opts \\ [])

@spec get_algo_futures_open_orders(recvWindow: any(), timestamp: any()) ::
  {:ok, any()} | {:error, any()}

Query Current Algo Open Orders (USER_DATA)

Weight(IP): 1

Details:

  • METHOD: get
  • URL: /sapi/v1/algo/futures/openOrders

Mandatory params:

Optional params:

  • timestamp - timestamp
  • recvWindow - The value cannot be greater than 60000
Link to this function

get_algo_futures_sub_orders(opts \\ [])

@spec get_algo_futures_sub_orders(
  recvWindow: any(),
  pageSize: any(),
  page: any(),
  algoId: any(),
  timestamp: any()
) :: {:ok, any()} | {:error, any()}

Query Sub Orders (USER_DATA)

Get respective sub orders for a specified algoId

Weight(IP): 1

Details:

  • METHOD: get
  • URL: /sapi/v1/algo/futures/subOrders

Mandatory params:

Optional params:

  • timestamp - timestamp
  • algoId -
  • page - Default is 1
  • pageSize - MIN 1, MAX 100; Default 100
  • recvWindow - The value cannot be greater than 60000
Link to this function

post_algo_futures_new_order_twap(symbol, side, quantity, duration, opts \\ [])

@spec post_algo_futures_new_order_twap(any(), any(), any(), any(),
  recvWindow: any(),
  limitPrice: any(),
  reduceOnly: any(),
  clientAlgoId: any(),
  positionSide: any(),
  timestamp: any()
) :: {:ok, any()} | {:error, any()}

Time-Weighted Average Price New Order (TRADE)

Send in a Twap new order. Only support on USDⓈ-M Contracts.

Weight(UID): 3000

Details:

  • METHOD: post
  • URL: /sapi/v1/algo/futures/newOrderTwap

Mandatory params:

  • symbol - Trading symbol eg. BTCUSDT
  • side - Trading side ( BUY or SELL )
  • quantity - Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 10,000 USDT and less than the equivalent of 1,000,000 USDT
  • duration - Duration for TWAP orders in seconds. [300, 86400];Less than 5min => defaults to 5 min; Greater than 24h => defaults to 24h

Optional params:

  • timestamp - timestamp
  • positionSide - Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode.
  • clientAlgoId - A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
  • reduceOnly - true or false. Default false; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
  • limitPrice - Limit price of the order; If it is not sent, will place order by market price by default
  • recvWindow - The value cannot be greater than 60000
Link to this function

post_algo_futures_new_order_vp(symbol, side, quantity, urgency, opts \\ [])

@spec post_algo_futures_new_order_vp(any(), any(), any(), any(),
  recvWindow: any(),
  limitPrice: any(),
  reduceOnly: any(),
  clientAlgoId: any(),
  positionSide: any(),
  timestamp: any()
) :: {:ok, any()} | {:error, any()}

Volume Participation New Order (TRADE)

Send in a VP new order. Only support on USDⓈ-M Contracts.

Weight(IP): 3000

  • Max open orders allowed: 10 orders.
  • Leverage of symbols and position mode will be the same as your futures account settings. You can set up through the trading page or fapi.
  • Receiving "success": true does not mean that your order will be executed. Please use the query order endpoints(GET sapi/v1/algo/futures/openOrders or GET sapi/v1/algo/futures/historicalOrders) to check the order status. For example: Your futures balance is insufficient, or open position with reduce only or position side is inconsistent with your own setting. In these cases you will receive "success": true, but the order status will be expired after we check it.

Details:

  • METHOD: post
  • URL: /sapi/v1/algo/futures/newOrderVp

Mandatory params:

  • symbol - Trading symbol eg. BTCUSDT
  • side - Trading side ( BUY or SELL )
  • quantity - Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 10,000 USDT and less than the equivalent of 1,000,000 USDT.
  • urgency - Represent the relative speed of the current execution; ENUM: LOW, MEDIUM, HIGH.

Optional params:

  • timestamp - timestamp
  • positionSide - Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode.
  • clientAlgoId - A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value.
  • reduceOnly - "true" or "false". Default "false"; Cannot be sent in Hedge Mode; Cannot be sent when you open a position.
  • limitPrice - Limit price of the order; If it is not sent, will place order by market price by default.
  • recvWindow - The value cannot be greater than 60000