UpsertGridBot (REST)
Grid Bot settings. Open API reads the current pair price and calculates the nearest levels and level count from gridPercentStep. Interval grids also use lowPrice and highPrice as borders. The calculated values then pass through the cabinet upsert validation.
Name shown in the cabinet.
My Grid BotEnabled exchange code.
BINANCETrading pair code on the selected exchange.
BTCUSDTAPI profile codes for the selected exchange.
Possible values: >= 1
["my-profile-code"]Selects spot or derivative market. Pass it as a query parameter; the body value is ignored.
Possible values: [spot, derivative]
Grid size mode: bounded Interval or expanding Infinite.
Possible values: [interval, infinite]
Execution method: classic or two-way.
Possible values: [classic, two_way]
Trade direction selected in the Grid Bot form.
Possible values: [long, short, neutral, two_way]
Price separating long and short grid orders. Match the cabinet calculation: Interval Long uses highPrice, Interval Short uses lowPrice, Interval Neutral uses (highPrice + lowPrice) / 2. Infinite Long uses 10000000000, Infinite Short uses 0 (the server-side sentinel), and Infinite Neutral uses the current last price. For Two-way, use the selected middle price from the grid setup; do not use 0 as a generic missing value.
Possible values: >= 0
Upper price boundary for an Interval grid.
Possible values: > 0
Lower price boundary for an Interval grid.
Possible values: > 0
Grid step as a fraction (1% = 0.01). Open API uses it with the server's current pair price to calculate grid levels.
Possible values: > 0
Conventional quote-asset amount allocated to the spot grid (USDT in BTC/USDT).
Possible values: >= 0
Conventional base-asset amount allocated to the spot grid (BTC in BTC/USDT).
Possible values: >= 0
Amount used for each entry order, in amountPerTradeType units.
Possible values: > 0
Unit used by amountPerTrade. In legacy bot fields, ref is the conventional base asset (BTC in BTC/USDT), and base is the conventional quote asset (USDT).
Possible values: [base, ref, percents]
Order amount multiplier on derivative exchanges.
Possible values: >= 1 and <= 125
Leverage configured for the bot.
Possible values: >= 1 and <= 125
Leverage setting applied on the exchange.
Possible values: >= 1 and <= 125
Existing webhook signal code to retain when editing; keep it secret.
Start immediately, on an indicator, or after a webhook alert.
Possible values: [immediate, indicator, webhook_alert]
Signal source for webhook_alert start condition.
Actions to take when the bot stops.
Possible values: [stop_only, stop_and_close_all, stop_and_close_all_and_convert_to_profit_currency]
Asset in which grid profit is kept: legacy ref is the conventional base asset; base is the conventional quote asset.
Possible values: [base, ref]
Always an absolute USD ($) amount, including spot pairs quoted in another currency. Stops the bot when total PnL reaches this profit; 10 means $10, not 10%.
Possible values: > 0
Order type used when taking profit.
Possible values: [market, best_bid_ask_limit]
takeProfitOrderTypeSettings objectnull
Settings for best_bid_ask_limit take-profit orders.
Place the take-profit limit order without taking existing liquidity.
Always an absolute USD ($) amount, including spot pairs quoted in another currency. Stops the bot when selected PnL reaches this loss; 10 means a loss of $10.
Possible values: > 0
Choose USD-valued total (realized plus unrealized) or unrealized PnL for the absolute stopLoss threshold.
Possible values: [total, unrealized]
totalAlways an absolute USD ($) amount. The selected PnL must reach this peak before the bot-level trailing stop activates.
Possible values: > 0
Always an absolute USD ($) amount. The bot-level trailing stop triggers after the selected PnL drops this far from its peak.
Possible values: > 0
Choose USD-valued total or unrealized PnL for the absolute trailing-stop peak and drop thresholds.
Possible values: [total, unrealized]
totalExit each grid position by take profit or trailing stop.
Possible values: [take_profit, trailing_stop]
take_profitFixed stop-loss distance for each grid position, as a fraction.
Possible values: > 0
Stop the bot when price leaves an Interval grid.
falseClassic grid: use market entries instead of resting limits. Two-way grid: when crossing a level from below, enter Long only; from above, enter Short only. This does not guarantee protection from a pump or dump.
falseFor two-way pump-protected entries, choose market or limit. In classic mode, pumpProtection itself selects market entries.
Possible values: [market, limit]
marketClient-side required-amount estimate stored with the bot.
indicators objectnull
Required for indicator start conditions. Use one indicator key.
rsi object
RSI settings for indicator start.
Candle period used to calculate RSI.
Possible values: >= 1 and <= 100
RSI threshold that starts the bot.
Possible values: >= 0.01 and <= 100
macd object
MACD settings for indicator start.
Fast moving-average period for MACD.
Possible values: >= 1 and <= 100
Slow moving-average period for MACD.
Possible values: >= 1 and <= 100
Signal-line period for MACD.
Possible values: >= 1 and <= 100
bb object
Bollinger Bands settings for indicator start.
Candle period used to calculate Bollinger Bands.
Possible values: >= 1 and <= 100
Standard-deviation multiplier for Bollinger Bands.
Possible values: >= 0.001 and <= 50
price_change object
Price-change settings for indicator start.
Price change that starts the bot, as a fraction.
Possible values: >= 0.005 and <= 0.1
{
"name": "My Grid Bot",
"exchangeCode": "BINANCE",
"pairCode": "BTCUSDT",
"profilesCodes": [
"my-profile-code"
],
"gridMarket": "spot",
"gridType": "interval",
"gridMethod": "classic",
"gridTradingType": "long",
"midPrice": 0,
"highPrice": 0,
"lowPrice": 0,
"gridPercentStep": 0,
"investmentBase": 0,
"investmentRef": 0,
"amountPerTrade": 0,
"amountPerTradeType": "base",
"amountPerTradeMultiplier": 0,
"leverage": 0,
"exchangeLeverage": 0,
"signalCode": "string",
"startCondition": "immediate",
"signalSource": "string",
"stopCondition": "stop_only",
"profitCurrencyType": "base",
"takeProfit": 0,
"takeProfitOrderType": "market",
"takeProfitOrderTypeSettings": "Unknown Type: object,null",
"stopLoss": 0,
"stopLossPnlCompareType": "total",
"trailingStopActivation": 0,
"trailingStopExecute": 0,
"trailingStopPnlCompareType": "total",
"strategyProfitCondition": "take_profit",
"strategyStopLossFixedPercentRatio": 0,
"stopOnOutOfGrid": false,
"pumpProtection": false,
"pumpProtectionOrderType": "market",
"maxRequiredAmount": "string",
"indicators": "Unknown Type: object,null"
}