Skip to main content

Send order

POST 

/sendorder

This endpoint allows sending a limit, stop, take profit or immediate-or-cancel order for a currently listed Futures contract.

Request

Body

required
    processBefore string

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

    orderType stringrequired

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

    The order type:

    • lmt - a limit order
    • post - a post-only limit order
    • mkt - an immediate-or-cancel order with 1% price protection
    • stp - a stop order
    • take_profit - a take profit order
    • ioc - an immediate-or-cancel 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. Note that different Futures have different contract sizes.

    limitPrice number

    The limit price associated with the order. Note that for stop orders, limitPrice denotes the worst price at which the stp or take_profit order can get filled at. If no limitPrice is provided the stp or take_profit order will trigger a market order. If placing a trailing_stop order then leave undefined.

    stopPrice number

    The stop price associated with a stop or take profit order.

    Required if orderType is stp or take_profit, but if placing a trailing_stop then leave undefined. Note that for stop orders, limitPrice denotes the worst price at which the stp or take_profit order can get filled at. If no limitPrice is provided the stp or take_profit order will trigger a market order.

    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]

    If placing a stp, take_profit or trailing_stop, the signal used for trigger.

    • mark - the mark price
    • index - the index price
    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

    Possible values: >= 0.1 and <= 50

    Required if the order type is trailing_stop. Maximum value of 50%, minimum value of 0.1% for 'PERCENT' 'maxDeviationUnit'.

    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.

    limitPriceOffsetValue number

    Can only be set for triggers, e.g. order types take_profit, stop and trailing_stop. If set, limitPriceOffsetUnit must be set as well. This defines a relative limit price depending on the trigger stopPrice. The price is determined when the trigger is activated by the triggerSignal. The offset can be positive or negative, there might be restrictions on the value depending on the limitPriceOffsetUnit.

    limitPriceOffsetUnit string

    Possible values: [QUOTE_CURRENCY, PERCENT]

    Can only be set together with limitPriceOffsetValue. This defines the unit for the relative limit price distance from the trigger's stopPrice.

Responses

Schema
    oneOf
    serverTime string

    Server time in Coordinated Universal Time (UTC)

    result string

    Possible values: [success]

    sendStatus object

    A structure containing information on the send order request.

    cliOrdId stringnull

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

    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 uuid

    The unique identifier of the order

    receivedTime string

    The date and time the order was received.

    status string

    Possible values: [placed, partiallyFilled, filled, cancelled, edited, marketSuspended, marketInactive, invalidPrice, invalidSize, tooManySmallOrders, insufficientAvailableFunds, wouldCauseLiquidation, clientOrderIdAlreadyExist, clientOrderIdTooBig, maxPositionViolation, outsidePriceCollar, wouldIncreasePriceDislocation, notFound, orderForEditNotAStop, orderForEditNotFound, postWouldExecute, iocWouldNotExecute, selfFill, wouldNotReducePosition, marketIsPostOnly, tooManyOrders, fixedLeverageTooHigh, clientOrderIdInvalid, cannotEditTriggerPriceOfTrailingStop, cannotEditLimitPriceOfTrailingStop, wouldProcessAfterSpecifiedTime]

    The status of the order, either of:

    • 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
    • maxPositionViolation - Order would cause you to exceed your maximum position in this contract.
    • 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 order would have executed outside of the price collar for its order type
    • postWouldExecute - the post-only order would be filled upon placement, thus is cancelled
    • iocWouldNotExecute - the immediate-or-cancel order would not execute.
    • wouldCauseLiquidation - returned when a new order would fill at a worse price than the mark price, causing the portfolio value to fall below maintenance margin and triggering a liquidation.
    • wouldNotReducePosition - the reduce only order would not reduce position.
    • wouldProcessAfterSpecifiedTime - order would be processed after the time specified in processBefore parameter.
Loading...