Skip to main content

Get Bot Parameter Limit

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

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

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

  • Rate limit:
    100 requests per second per IP.

HTTP Request

POST/v5/fmartingalebot/getlimit

Request Parameters

ParameterRequiredTypeComments
symboltruestringTrading pair symbol, uppercase only (e.g. BTCUSDT)
martingale_modetrueintegerStrategy direction: 1 Long, 2 Short
leveragetruestringPosition leverage multiplier (e.g. "5" means 5x). Must be >= 1
price_float_percentfalsestringPrice movement trigger as percentage (e.g. "0.015" means 1.5%)
add_position_percentfalsestringPosition add scaling as percentage of base position (e.g. "1" = 1x)
add_position_numfalseintegerMaximum number of position adds per round
init_marginfalsestringInitial investment in quote currency (decimal string)
round_tp_percentfalsestringSingle round take-profit as percentage (e.g. "0.03" means 3%)
sl_percentfalsestringStop-loss as percentage (e.g. "0.2" means 20%)
entry_pricefalsestringEntry trigger price (decimal string)
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
price_float_percentobjectAcceptable price float percentage range (min / max)
add_position_percentobjectAcceptable add position percentage range (min / max)
add_position_numobjectAcceptable add position count range (min / max)
init_marginobjectAcceptable initial margin range (min / max, decimal strings in quote currency)
round_tp_percentobjectAcceptable round take-profit percentage range (min / max)
sl_percentobjectAcceptable stop-loss percentage range (min / max)
entry_priceobjectAcceptable entry price range (min / max)
leverageobjectAcceptable leverage range (min / max)

Check Code Values

check_codeDescription
F_MART_LIMIT_CHECK_CODE_F_MART_CHECK_CODE_SUCCESS_UNSPECIFIEDOK — no error
F_MART_LIMIT_CHECK_CODE_F_MART_PRICE_FLOAT_PERCENT_TOO_HIGHPrice float percentage too high
F_MART_LIMIT_CHECK_CODE_F_MART_PRICE_FLOAT_PERCENT_TOO_LOWPrice float percentage too low
F_MART_LIMIT_CHECK_CODE_F_MART_ADD_POSITION_PERCENT_TOO_HIGHAdd position percentage too high
F_MART_LIMIT_CHECK_CODE_F_MART_ADD_POSITION_PERCENT_TOO_LOWAdd position percentage too low
F_MART_LIMIT_CHECK_CODE_F_MART_ADD_POSITION_NUM_TOO_HIGHAdd position count too high
F_MART_LIMIT_CHECK_CODE_F_MART_ADD_POSITION_NUM_TOO_LOWAdd position count too low
F_MART_LIMIT_CHECK_CODE_F_MART_INIT_MARGIN_TOO_HIGHInitial margin too high
F_MART_LIMIT_CHECK_CODE_F_MART_INIT_MARGIN_TOO_LOWInitial margin too low
F_MART_LIMIT_CHECK_CODE_F_MART_ROUND_TARGET_TP_PERCENT_TOO_HIGHRound TP percentage too high
F_MART_LIMIT_CHECK_CODE_F_MART_ROUND_TARGET_TP_PERCENT_TOO_LOWRound TP percentage too low
F_MART_LIMIT_CHECK_CODE_F_MART_SL_PER_TOO_HIGHStop-loss percentage too high
F_MART_LIMIT_CHECK_CODE_F_MART_SL_PER_TOO_LOWStop-loss percentage too low
F_MART_LIMIT_CHECK_CODE_F_MART_ENTRY_PRICE_TOO_HIGHEntry price too high
F_MART_LIMIT_CHECK_CODE_F_MART_ENTRY_PRICE_TOO_LOWEntry price too low
F_MART_LIMIT_CHECK_CODE_F_MART_LEVERAGE_TOO_HIGHLeverage too high
F_MART_LIMIT_CHECK_CODE_F_MART_LEVERAGE_TOO_LOWLeverage too low

Request Example

POST /v5/fmartingalebot/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

{
"symbol": "MNTUSDT",
"martingale_mode": 1,
"leverage": "5",
"price_float_percent": "0.16",
"add_position_percent": "1.8",
"add_position_num": 5,
"round_tp_percent": "0.1",
"init_margin": "1000",
"sl_percent": "0.5",
"auto_cycle_toggle": 2
}

Response Example

{
"retCode": 0,
"retMsg": "success",
"result": {
"status_code": 0,
"debug_msg": "",
"check_code": "F_MART_LIMIT_CHECK_CODE_F_MART_CHECK_CODE_SUCCESS_UNSPECIFIED",
"price_float_percent": {
"max": "0.199",
"min": "0.001"
},
"add_position_percent": {
"max": "2",
"min": "1"
},
"add_position_num": {
"max": "10",
"min": "1"
},
"init_margin": {
"max": "34004.22",
"min": "0.7682"
},
"round_tp_percent": {
"max": "4.45",
"min": "0.01"
},
"sl_percent": {
"max": "1",
"min": "0"
},
"entry_price": {
"max": "0.7086",
"min": "0.2105"
},
"leverage": {
"max": "20",
"min": "1"
}
},
"retExtInfo": {},
"time": 1774510798514
}