Skip to main content

Close Grid Bot

Close a running futures grid trading bot. The bot will cancel all pending grid orders and close positions.

info

HTTP Request

POST/v5/fgridbot/close

Request Parameters

ParameterRequiredTypeComments
bot_idtruestringBot ID to close, obtained from Create Futures Grid Bot response

Response Parameters

ParameterTypeComments
status_codeinteger0 = success, non-zero = error
bot_idstringThe closed bot ID
debug_msgstringDebug message (testnet only)

Request Example

POST /v5/fgridbot/close HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1672211928338
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"bot_id": "612330315406398322"
}

Response Example

{
"retCode": 0,
"retMsg": "success",
"result": {
"status_code": 200,
"debug_msg": "bot has already been canceled",
"bot_id": "612330315406398322"
},
"retExtInfo": {},
"time": 1774508410683
}