Skip to main content

Batch order management

POST 

/v3/batchorder

This endpoint allows sending limit or stop order(s) and/or cancelling open order(s) and/or editing open order(s) for a currently listed Futures contract in batch.

When editing an order, if the trailingStopMaxDeviation and trailingStopDeviationUnit parameters are sent unchanged, the system will recalculate a new stop price upon successful order modification.

Request

Body

required
    processBefore string

    The time before which the request should be processed, otherwise it is rejected.

    json stringrequired
    info

    This parameter is required to be encoded as a json string, please see example.

    batchOrder object[]required

    A list containing structures of order sending and order cancellation instructions. The list is in no particular order.

  • Array [
  • oneOf
    order string

    Possible values: [send]

    Always send.

    order_tag stringrequired

    An arbitrary string provided client-side to tag the order for the purpose of mapping order sending instructions to the API's response.

    orderType stringrequired

    Possible values: [lmt, ioc, post, stp, take_profit]

    Order type:

    • lmt - a limit order,
    • post - a post-only limit order,
    • take_profit - a take profit order or
    • stp - a stop order
    • trailing_stop - a trailing stop order
    symbol stringrequired

    The symbol of the Futures.

    side stringrequired

    Possible values: [buy, sell]

    The direction of the order.

    size numberrequired

    The size associated with the order.

    limitPrice number

    The limit price associated with the order. If placing a trailing_stop order then leave undefined.

    stopPrice number

    The stop price associated with a stop order. Required if orderType is stp. Note that for stp orders, limitPrice is also required and denotes the worst price at which the stp order can get filled

    cliOrdId string

    Possible values: <= 100 characters

    The order identity that is specified from the user. It must be globally unique.

    triggerSignal string

    Possible values: [mark, spot, last]

    reduceOnly boolean

    Set as 'true' if you wish the order to only reduce an existing position. Any order which increases an existing position will be rejected. Default 'false'.

    trailingStopMaxDeviation number

    Required if the order type is trailing_stop.

    Is the maximum distance the trailing stop's trigger price may trail behind the requested trigger signal. It defines the threshold at which the trigger price updates.

    trailingStopDeviationUnit string

    Possible values: [PERCENT, QUOTE_CURRENCY]

    Required if the order type is trailing_stop.

    This defines how the trailing trigger price is calculated from the requested trigger signal. For example, if the max deviation is set to 10, the unit is 'PERCENT', and the underlying order is a sell, then the trigger price will never be more then 10% below the trigger signal. Similarly, if the deviation is 100, the unit is 'QUOTE_CURRENCY', the underlying order is a sell, and the contract is quoted in USD, then the trigger price will never be more than $100 below the trigger signal.

  • ]

Responses

Schema
    oneOf
    serverTime string

    Server time in Coordinated Universal Time (UTC)

    result string

    Possible values: [success]

    batchStatus object[]required

    A structure containing information on the send order request.

  • Array [
  • cliOrdId string

    The unique client order identifier. This field is returned only if the order has a client order ID.

    dateTimeReceived stringnull

    The date and time the order was received.

    orderEvents object[]
  • Array [
  • oneOf
    type ApiOrderEventType (string)

    Possible values: [place, cancel, edit, reject, execution]

    Always place.

    order object

    The placed order.

    orderId string

    The UID associated with the order.

    cliOrdId stringnull

    The client order id or null if order does not have one.

    type string

    Possible values: [lmt, ioc, post, liquidation, assignment, stp, unwind, block]

    The order type

    symbol string

    The symbol of the Futures.

    side string

    Possible values: [buy, sell]

    The side associated with the order

    quantity number

    The quantity (size) associated with the order.

    filled number

    The total amount of the order that has been filled.

    limitPrice number

    The limit price associated with a limit order.

    reduceOnly boolean

    Is the order a reduce only order or not.

    timestamp string

    The date and time the order was placed.

    lastUpdateTimestamp string

    The date and time the order was edited.

    reducedQuantity numbernull

    The amount of quantity that was removed before placement or null if the order is not a reduce only.

  • ]
  • order_id stringnull

    The unique identifier of the order.

    order_tag stringnull

    The arbitrary string provided client-side when the order was sent for the purpose of mapping order sending instructions to the API's response.

    status string

    Possible values: [placed, cancelled, invalidOrderType, invalidSide, invalidSize, invalidPrice, insufficientAvailableFunds, selfFill, tooManySmallOrders, marketSuspended, marketInactive, clientOrderIdAlreadyExist, clientOrderIdTooLong, outsidePriceCollar, postWouldExecute, iocWouldNotExecute]

    The status of the order:

    • placed - the order was placed successfully
    • cancelled - the order was cancelled successfully
    • invalidOrderType - the order was not placed because orderType is invalid
    • invalidSide - the order was not placed because side is invalid
    • invalidSize - the order was not placed because size is invalid
    • invalidPrice - the order was not placed because limitPrice and/or stopPrice are invalid
    • insufficientAvailableFunds - the order was not placed because available funds are insufficient
    • selfFill - the order was not placed because it would be filled against an existing order belonging to the same account
    • tooManySmallOrders - the order was not placed because the number of small open orders would exceed the permissible limit
    • marketSuspended - the order was not placed because the market is suspended
    • marketInactive - the order was not placed because the market is inactive
    • clientOrderIdAlreadyExist - the specified client ID already exist
    • clientOrderIdTooLong - the client ID is longer than the permissible limit
    • outsidePriceCollar - the limit order crosses the spread but is an order of magnitude away from the mark price - fat finger control
    • postWouldExecute - the post-only order would be filled upon placement, thus is cancelled
    • iocWouldNotExecute - the immediate-or-cancel order would not execute
  • ]
Loading...