Place an algo order
POST🔒 Trading
Places an algorithmic order. Supported orderType variants: OCO, TRAILING, CONDITIONAL, TWAP, and PEG; each variant has its own required fields.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| BROKER-ID | String | No | Optional broker/partner identifier to tag orders placed through them |
Request Body
Conditional
| Name | Type | Required | Description |
|---|---|---|---|
| orderType | String | Yes | Order type. Must be CONDITIONAL for this variant. — LIMIT · MARKET · OCO · TWAP · PEG · CONDITIONAL · TRAILING |
| clOrderId | String | No | Client-assigned order identifier for tracking and idempotency. |
| symbol | String | Yes | Trading pair symbol. |
| orderSide | String | Yes | Order side: BUY or SELL. |
| orderSize | Long | Yes | Order size in number of contracts. |
| positionMode | String | No | Position mode this order applies to (one-way or hedge). — ONE_WAY · HEDGE · ISOLATED |
| timeInForce | String | No | Time-in-force policy applied once the order is triggered. — FOK · GTC · IOC · HALFSEC · HALFMIN · FIVEMIN · HOUR · TWELVEHOUR · DAY · WEEK · MONTH |
| reduceOnly | Boolean | No | If true, the order can only reduce an existing position and cannot open or increase one. |
| postOnly | Boolean | No | If true, the triggered order is rejected if it would take liquidity, ensuring maker-only execution. |
| orderPrice | Double | No | Limit price used once the order is triggered. Omit for a market-style trigger. |
| triggerPrice | Double | No | Price at which the order becomes active. |
| triggerType | String | No | Reference price type used to evaluate the trigger. — INDEX_PRICE · LAST_PRICE · MARK_PRICE |
| takeProfitTriggerType | String | No | Reference price type used to evaluate the take-profit trigger. — INDEX_PRICE · LAST_PRICE · MARK_PRICE |
| stopLossTriggerType | String | No | Reference price type used to evaluate the stop-loss trigger. — INDEX_PRICE · LAST_PRICE · MARK_PRICE |
| takeProfitTriggerPrice | Double | No | Take-profit trigger price attached to the resulting order. |
| stopLossTriggerPrice | Double | No | Stop-loss trigger price attached to the resulting order. |
OcO
| Name | Type | Required | Description |
|---|---|---|---|
| orderType | String | Yes | Order type. Must be OCO for this variant. — LIMIT · MARKET · OCO · TWAP · PEG · CONDITIONAL · TRAILING |
| clOrderId | String | No | Client-assigned order identifier for tracking and idempotency. |
| symbol | String | Yes | Trading pair symbol. |
| orderSide | String | Yes | Order side: BUY or SELL. |
| orderSize | Long | Yes | Order size in number of contracts. |
| positionMode | String | No | Position mode this order applies to (one-way or hedge). — ONE_WAY · HEDGE · ISOLATED |
| timeInForce | String | No | Time-in-force policy applied to each leg once triggered. — FOK · GTC · IOC · HALFSEC · HALFMIN · FIVEMIN · HOUR · TWELVEHOUR · DAY · WEEK · MONTH |
| reduceOnly | Boolean | No | If true, both legs can only reduce an existing position. |
| postOnly | Boolean | No | If true, each leg is rejected if it would take liquidity, ensuring maker-only execution. |
| takeProfitOrderPrice | Double | Yes | Limit price of the take-profit leg. |
| stopLossOrderPrice | Double | Yes | Limit price of the stop-loss leg once triggered. |
| stopLossTriggerPrice | Double | Yes | Price at which the stop-loss leg is triggered. |
| stopLossTriggerType | String | No | Reference price type used to evaluate the stop-loss trigger. — INDEX_PRICE · LAST_PRICE · MARK_PRICE |
Peg
| Name | Type | Required | Description |
|---|---|---|---|
| orderType | String | Yes | Order type. Must be PEG for this variant. — LIMIT · MARKET · OCO · TWAP · PEG · CONDITIONAL · TRAILING |
| clOrderId | String | No | Client-assigned order identifier for tracking and idempotency. |
| symbol | String | Yes | Trading pair symbol. |
| orderSide | String | Yes | Order side: BUY or SELL. |
| orderSize | Long | Yes | Order size in number of contracts. |
| positionMode | String | No | Position mode this order applies to (one-way or hedge). — ONE_WAY · HEDGE · ISOLATED |
| orderPrice | Double | No | Optional worst-price limit; the pegged price will not cross this bound. |
| deviation | Double | Yes | Offset applied to the pegged reference price. |
| stealth | Double | Yes | Portion of the order size displayed on the book; the remainder is hidden. |
Trailing
| Name | Type | Required | Description |
|---|---|---|---|
| orderType | String | Yes | Order type. Must be TRAILING for this variant. — LIMIT · MARKET · OCO · TWAP · PEG · CONDITIONAL · TRAILING |
| clOrderId | String | No | Client-assigned order identifier for tracking and idempotency. |
| symbol | String | Yes | Trading pair symbol. |
| orderSide | String | Yes | Order side: BUY or SELL. |
| orderSize | Long | Yes | Order size in number of contracts. |
| positionMode | String | No | Position mode this order applies to (one-way or hedge). — ONE_WAY · HEDGE · ISOLATED |
| reduceOnly | Boolean | No | If true, the order can only reduce an existing position and cannot open or increase one. |
| trailValue | Double | Yes | Trailing distance the stop price maintains from the best reached reference price. |
| trailValueType | String | Yes | How trailValue is interpreted (absolute price offset or percentage). — DISTANCE · PERCENTAGE |
| trailTriggerPriceType | String | Yes | Reference price type used to evaluate the trailing trigger. — INDEX_PRICE · LAST_PRICE · MARK_PRICE |
| activationTriggerPrice | Double | No | Optional price at which the trailing logic starts. Trailing is inactive until this price is reached. |
| activationTriggerType | String | No | Reference price type used to evaluate the activation price. — INDEX_PRICE · LAST_PRICE · MARK_PRICE |
Twap
| Name | Type | Required | Description |
|---|---|---|---|
| orderType | String | Yes | Order type. Must be TWAP for this variant. — LIMIT · MARKET · OCO · TWAP · PEG · CONDITIONAL · TRAILING |
| clOrderId | String | No | Client-assigned order identifier for tracking and idempotency. |
| symbol | String | Yes | Trading pair symbol. |
| orderSide | String | Yes | Order side: BUY or SELL. |
| orderSize | Long | Yes | Total order size in number of contracts, distributed across child orders. |
| reduceOnly | Boolean | No | If true, the order can only reduce an existing position and cannot open or increase one. |
| timePeriod | Long | No | Total execution window in seconds over which child orders are dispatched. |
| randomizeSize | Boolean | No | If true, individual child order sizes are randomized within limits to reduce predictability. |
| subTwapMaxOrderSize | Double | No | Maximum size of each child order. |
| maxSpread | Double | No | Maximum acceptable bid-ask spread. Child orders are paused when the spread is wider. |
| makerFirst | Boolean | No | If true, child orders prefer maker execution before falling back to taker behavior. |
| maxDistanceThroughBook | Double | No | Maximum distance a child order may cross into the order book. |
| pausePrice | Double | No | Reference price beyond which the TWAP schedule pauses to avoid adverse execution. |
| activationTriggerPrice | Double | No | Optional price at which the TWAP schedule begins. Inactive until this price is reached. |
| activationTriggerType | String | No | Reference price type used to evaluate the activation price. — INDEX_PRICE · LAST_PRICE · MARK_PRICE |
Response Content
| Name | Type | Description |
|---|---|---|
| status | Integer | Order status code returned for this placement. |
| type | Integer | Order type code. |
| symbol | String | Trading pair symbol. |
| postOnly | Boolean | True if the order was accepted as maker-only. |
| orderSide | String | Order side: BUY or SELL. |
| orderId | String | Server-assigned order id. |
| clOrderID | String | Client-assigned order id echoed from the request. |
| timestamp | Long | Server timestamp of the placement, in milliseconds since epoch. |
| price | Double | Limit price submitted with the order. |
| avgFilledPrice | Double | Average fill price across executions so far. Zero if nothing has filled. |
| message | String | Human-readable message returned by the platform (e.g. rejection reason). |
| originalOrderSize | Long | Original order size in number of contracts as submitted. |
| currentOrderSize | Long | Current remaining order size after fills or amendments. |
| filledSize | Long | Size filled in the most recent match, in contracts. |
| totalFilledSize | Long | Cumulative filled size across all matches, in contracts. |
| remainingSize | Long | Remaining unfilled size, in contracts. |
| positionMode | String | Position mode this order applies to (one-way or hedge). — ONE_WAY · HEDGE · ISOLATED |
| positionDirection | String | Position direction the order will affect: LONG or SHORT. |
| positionId | String | Identifier of the position the order is bound to. |
| timeInForce | String | Time-in-force policy applied to the order (e.g. GTC, IOC, FOK). |
example
POST
https://api.btse.com/futures/api/v3/trade/orders/algoRequest (Conditional)
{
"symbol": "BTC-PERP",
"orderType": "CONDITIONAL",
"orderSide": "SELL",
"orderSize": 1,
"reduceOnly": true,
"triggerPrice": 63010.5,
"triggerType": "MARK_PRICE"
}
Request (OCO)
{
"symbol": "BTC-PERP",
"orderType": "OCO",
"orderSide": "SELL",
"orderSize": 1,
"reduceOnly": true,
"takeProfitOrderPrice": 63010.5,
"stopLossOrderPrice": 57009.5,
"stopLossTriggerPrice": 57009.5,
"stopLossTriggerType": "MARK_PRICE"
}
Request (Trailing)
{
"symbol": "BTC-PERP",
"orderType": "TRAILING",
"orderSide": "SELL",
"orderSize": 1,
"reduceOnly": true,
"trailValue": 3000.5,
"trailValueType": "DISTANCE",
"trailTriggerPriceType": "MARK_PRICE",
"activationTriggerPrice": 63010.5,
"activationTriggerType": "MARK_PRICE"
}
Request (Twap)
{
"symbol": "BTC-PERP",
"orderType": "TWAP",
"orderSide": "SELL",
"orderSize": 1,
"reduceOnly": true,
"timePeriod": 3600,
"activationTriggerPrice": 63010.5,
"activationTriggerType": "MARK_PRICE"
}
Request (Peg)
{
"symbol": "BTC-PERP",
"orderType": "PEG",
"orderSide": "BUY",
"orderSize": 1,
"orderPrice": 57009.5,
"deviation": 0,
"stealth": 1
}
Response (Conditional)
{
"status": 9,
"type": 0,
"symbol": "BTC-PERP",
"postOnly": false,
"orderSide": "SELL",
"orderId": "5591478a-c3ed-45b6-a1d4-f14404996d51",
"clOrderID": "",
"timestamp": 1784882344679,
"price": 0,
"avgFilledPrice": 0,
"message": null,
"originalOrderSize": 1,
"currentOrderSize": 1,
"filledSize": 0,
"totalFilledSize": 0,
"remainingSize": 1,
"positionMode": "ONE_WAY",
"positionDirection": null,
"positionId": "BTC-PERP-USDT",
"timeInForce": "GTC"
}
Response (OCO)
{
"status": 2,
"type": 0,
"symbol": "BTC-PERP",
"postOnly": false,
"orderSide": "SELL",
"orderId": "cfb7efd5-59d3-45d1-9eb3-a053d644108a",
"clOrderID": "",
"timestamp": 1784882344747,
"price": 63010.5,
"avgFilledPrice": 0,
"message": null,
"originalOrderSize": 1,
"currentOrderSize": 1,
"filledSize": 0,
"totalFilledSize": 0,
"remainingSize": 1,
"positionMode": "ONE_WAY",
"positionDirection": null,
"positionId": "BTC-PERP-USDT",
"timeInForce": "GTC"
}
Response (Trailing)
{
"status": 9,
"type": 0,
"symbol": "BTC-PERP",
"postOnly": false,
"orderSide": "SELL",
"orderId": "2c6a3aaf-d0c5-46f7-a71d-cda3ffc62cbb",
"clOrderID": "2c6a3aaf-d0c5-46f7-a71d-cda3ffc62cbb",
"timestamp": 1784882344836,
"price": 0,
"avgFilledPrice": 0,
"message": null,
"originalOrderSize": 1,
"currentOrderSize": 1,
"filledSize": 0,
"totalFilledSize": 0,
"remainingSize": 1,
"positionMode": "ONE_WAY",
"positionDirection": null,
"positionId": "BTC-PERP-USDT",
"timeInForce": "GTC"
}
Response (Twap)
{
"status": 9,
"type": 0,
"symbol": "BTC-PERP",
"postOnly": false,
"orderSide": "SELL",
"orderId": "4196fd02-5bd0-48e9-acba-496d88dd64f0",
"clOrderID": "4196fd02-5bd0-48e9-acba-496d88dd64f0",
"timestamp": 1784882344913,
"price": 0,
"avgFilledPrice": 0,
"message": null,
"originalOrderSize": 1,
"currentOrderSize": 1,
"filledSize": 0,
"totalFilledSize": 0,
"remainingSize": 1,
"positionMode": "ONE_WAY",
"positionDirection": null,
"positionId": "BTC-PERP-USDT",
"timeInForce": "GTC"
}
Response (Peg)
{
"status": 2,
"type": 0,
"symbol": "BTC-PERP",
"postOnly": false,
"orderSide": "BUY",
"orderId": "484fd831-8399-4b25-933a-8a5dd111e488",
"clOrderID": "",
"timestamp": 1784882344954,
"price": 57009.5,
"avgFilledPrice": 0,
"message": null,
"originalOrderSize": 1,
"currentOrderSize": 1,
"filledSize": 0,
"totalFilledSize": 0,
"remainingSize": 1,
"positionMode": "ONE_WAY",
"positionDirection": null,
"positionId": "BTC-PERP-USDT",
"timeInForce": "GTC"
}