Skip to main content

Get Bot Parameter Limit

Validate futures combo bot input parameters and return allowable ranges. Use before creating a combo bot to ensure parameters are within valid bounds.

info
  • When to call:
    Always call this endpoint before Create Futures Combo Bot.

  • check_code:
    LIMIT_CHECK_CODE_SUCCESS_UNSPECIFIED = all parameters are valid. Any other value identifies the specific parameter out of range.

  • Rate limit:
    10 requests per second per UID.

HTTP Request

POST/v5/fcombobot/getlimit

Request Parameters

ParameterRequiredTypeComments
leveragetruestringPosition leverage multiplier (e.g. "5" means 5x). Must be >= 1
init_margintruestringInitial investment in quote currency (decimal string)
adjust_position_modetrueintegerRebalancing trigger mode: 1 Time, 2 Percentage, 3 Time or %, 4 Manual, 5 On settings change, 6 On transfer
symbol_settingstruearray<object>Per-symbol portfolio configuration
> symboltruestringTrading pair symbol (e.g. BTCUSDT)
> target_position_percenttruestringTarget portfolio weight as percentage. All symbols must sum to 1
> sidetrueintegerPosition direction: 1 Long, 2 Short
adjust_position_percentfalsestringRebalancing drift threshold as percentage
adjust_position_time_intervalfalseintegerRebalancing time interval in seconds
sl_percentfalsestringStop-loss as percentage (e.g. "0.2" means 20%)
tp_percentfalsestringTake-profit as percentage (e.g. "0.5" means 50%)
trailing_stop_percentfalsestringTrailing stop callback as percentage (e.g. "0.05" means 5%)
need_to_slippagefalsebooleanWhether to include slippage calculation

Response Parameters

ParameterTypeComments
status_codeinteger0 = success, non-zero = error
debug_msgstringDebug message (testnet only)
check_codestringValidation result. See check code table below
init_marginobjectAcceptable initial margin range (min / max, decimal strings in quote currency)
leverageobjectAcceptable leverage range (min / max)
adjust_position_percentobjectAcceptable rebalancing drift threshold range (min / max)
adjust_position_time_intervalobjectAcceptable rebalancing time interval range in seconds (min / max)
sl_percentobjectAcceptable stop-loss percentage range (min / max)
tp_percentobjectAcceptable take-profit percentage range (min / max)
trailing_stop_percentobjectAcceptable trailing stop percentage range (min / max)

Check Code Values

check_codeDescription
LIMIT_CHECK_CODE_SUCCESS_UNSPECIFIEDOK — no error
LIMIT_CHECK_CODE_SYMBOL_NUM_TOO_LOWSymbol count too low
LIMIT_CHECK_CODE_SYMBOL_NUM_TOO_HIGHSymbol count too high
LIMIT_CHECK_CODE_ADJUST_POSITION_PERCENT_TOO_LOWRebalancing threshold too low
LIMIT_CHECK_CODE_ADJUST_POSITION_PERCENT_TOO_HIGHRebalancing threshold too high
LIMIT_CHECK_CODE_ADJUST_POSITION_TIME_INTERVAL_TOO_LOWRebalancing time interval too short
LIMIT_CHECK_CODE_ADJUST_POSITION_TIME_INTERVAL_TOO_HIGHRebalancing time interval too long
LIMIT_CHECK_CODE_INIT_MARGIN_TOO_HIGHInitial margin too high
LIMIT_CHECK_CODE_INIT_MARGIN_TOO_LOWInitial margin too low
LIMIT_CHECK_CODE_SL_PER_TOO_HIGHStop-loss percentage too high
LIMIT_CHECK_CODE_SL_PER_TOO_LOWStop-loss percentage too low
LIMIT_CHECK_CODE_TP_PER_TOO_HIGHTake-profit percentage too high
LIMIT_CHECK_CODE_TP_PER_TOO_LOWTake-profit percentage too low
LIMIT_CHECK_CODE_LEVERAGE_TOO_HIGHLeverage too high
LIMIT_CHECK_CODE_LEVERAGE_TOO_LOWLeverage too low
LIMIT_CHECK_CODE_TRAILING_STOP_PERCENT_TOO_LOWTrailing stop percentage too low
LIMIT_CHECK_CODE_TRAILING_STOP_PERCENT_TOO_HIGHTrailing stop percentage too high

Request Example

POST /v5/fcombobot/getlimit 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

{
"leverage": "5",
"init_margin": "500",
"adjust_position_mode": 3,
"adjust_position_percent": "0.05",
"adjust_position_time_interval": 3600,
"symbol_settings": [
{
"symbol": "BTCUSDT",
"target_position_percent": "0.5",
"side": 1
},
{
"symbol": "ETHUSDT",
"target_position_percent": "0.5",
"side": 2
}
],
"sl_percent": "0.2",
"tp_percent": "0.5",
"need_to_slippage": false
}

Response Example

{
"retCode": 0,
"retMsg": "success",
"result": {
"status_code": 0,
"debug_msg": "",
"check_code": "LIMIT_CHECK_CODE_SUCCESS_UNSPECIFIED",
"adjust_position_percent": {
"max": "0.5",
"min": "0.01"
},
"adjust_position_time_interval": {
"max": "2419200",
"min": "1800"
},
"init_margin": {
"max": "576840",
"min": "352.3"
},
"sl_percent": {
"max": "0.99",
"min": "0.01"
},
"tp_percent": {
"max": "100",
"min": "0.01"
},
"leverage": {
"max": "100",
"min": "1"
},
"trailing_stop_percent": {
"max": "0.99",
"min": "0.05"
}
},
"retExtInfo": {},
"time": 1774505009140
}