Create Grid Bot

Description: Creates a new Grid Bot

Permission: BOTS_WRITEE Security: SIGNED

POST

/ver1/grid_bots/manual

Body parameters

name integer Grid bot name specified by the user If not specified, the system will generate a default name automatically Characters: [1 ... 40]

account_id integer required ID of the exchange account entity where the Grid Bot is created

pair string required Trading pair in 3Commas format

Use the All market pairs endpoint to retrieve the list of supported pairs and their format

upper_price number required The maximum price of the trading range, above which the bot will not place sell orders

lower_price number required The minimum price of the trading range, below which the bot will not place buy orders

grids_quantity integer required The number of grid levels between the upper and lower price boundaries

grid_type string Type of Grid Bot configuration: geometric or arithmetic Default: arithmetic

quantity_per_grid number required Quantity allocated for each Grid Bot level order

order_currency_type string The currency type used for placing orders: base or quote Default: quote

profit_currency_type string The currency in which the bot will generate profit: base or quote Default: quote

upper_stop_loss_enabled boolean Indicates if upper stop-loss settings are enabled. Use true to activate the settings group

upper_stop_loss_action string The action to perform if the asset price reaches or exceeds the set upper stop-loss level: stop_bot, stop_bot_and_sell, stop_bot_and_close_position

upper_stop_loss_price number The price level that triggers the upper stop-loss action

lower_stop_loss_enabled boolean Indicates if lower stop-loss settings are enabled. Use true to activate the settings group

lower_stop_loss_action string The action to perform if the asset price reaches or falls below the set lower stop-loss level: stop_bot, stop_bot_and_sell, stop_bot_and_close_position Default: stop_bot

lower_stop_loss_price number The price level that triggers the lower stop-loss action

leverage_type string Type of leverage used for the futures account: cross,isolated Default: not_specified,

leverage_custom_value number Custom leverage value set for the Grid Bot

mode string Type of strategy used by the bot: reversal, long, short

max_active_sell_lines integer Maximum number of active sell orders that can be placed simultaneously

trailing_up_enabled boolean Indicates if the trailing-up feature is enabled (true or not (false)

trailing_down_enabled boolean Indicates if the trailing-down feature is enabled (true or not (false)

expansion_down_enabled boolean Indicates if the grid expansion downwards is enabled (true or not (false)

expansion_down_stop_price number required The price at which the downward grid expansion should stop This parameter is required when expansion_down_enabled is set to true

expansion_up_enabled boolean Indicates if the grid expansion upwards is enabled (true or not (false)

expansion_up_stop_price number required The price at which the upward grid expansion should stop. This parameter is required when expansion_up_enabled is set to true.

ignore_warnings boolean Ignores warnings and forces the creation of the Grid Bot (true) or not (false)

note integer Optional user-defined note for the Grid Bot. [1 ... 300] characters

Parameters response

If successful, the response includes a copy of Grid Bot entity.

Example Request

{
   "account_id": 12345678,
   "pair": "USDT_ETH",
   "name": "Test GRID",
   "upper_price": 1.1,
   "lower_price": 0.56,
   "quantity_per_grid": 40,
   "grids_quantity": 28,
   "max_active_buy_lines": 28,
   "max_active_sell_lines": 28,
   "order_currency_type": "base",
   "profit_currency_type": "base",
   "ignore_warnings": false,
   "trailing_up_enabled": false,
   "trailing_down_enabled": true,
   "grid_type": "arithmetic",
   "expansion_down_enabled": false,
   "expansion_up_enabled": true,
   "expansion_up_stop_price": 1.57
}

Example Response and errors

Status: 201 Created

{
   "id": 2291723,
   "account_id": 73223,
   "account_name": "binance",
   "is_enabled": false,
   "grids_quantity": "50",
   "created_at": "2024-07-17T14:46:46.414Z",
   "updated_at": "2024-07-17T14:46:46.505Z",
   "strategy_type": "manual",
   "upper_stop_loss_enabled": true,
   "lower_stop_loss_enabled": true,
   "note": "Example bot",
   "editable": true,
   "lower_price": "56000.0",
   "lower_stop_loss_price": "50000.0",
   "lower_stop_loss_action": "stop_bot_and_sell",
   "upper_price": "72000.0",
   "upper_stop_loss_price": "75000.0",
   "upper_stop_loss_action": "stop_bot",
   "quantity_per_grid": "15.0",
   "leverage_type": "not_specified",
   "leverage_custom_value": null,
   "name": "USDT_BTC EXAMPLE",
   "pair": "USDT_BTC",
   "start_price": null,
   "grid_price_step": "326.530612244897959183673469387755102041",
   "current_profit": "0.0",
   "current_profit_usd": "0.0",
   "total_profits_count": "0",
   "bought_volume": "0.0",
   "sold_volume": "0.0",
   "profit_percentage": "0.0",
   "current_price": "65229.37",
   "max_active_buy_lines": "50",
   "max_active_sell_lines": "50",
   "order_currency_type": "quote",
   "profit_currency_type": "quote",
   "trailing_up_enabled": "true",
   "grid_type": "arithmetic",
   "investment_base_currency": "0.0",
   "investment_quote_currency": "0.0",
   "unrealized_profit_loss": "0",
   "current_profit_loss": null,
   "current_profit_loss_percent": null,
   "orderbook_price_currency": "USDT",
   "expansion_down_enabled": "true",
   "expansion_down_stop_price": "54000.0",
   "grid_lines": [
      {
         "id": 253750214,
         "price": "65142.86",
         "side": null,
         "order_placed": false
      },
      {
         "id": 253750235,
         "price": "72000.0",
         "side": "sell",
         "order_placed": false
      },
      ...
      
      {
         "id": 253750213,
         "price": "64816.33",
         "side": "buy",
         "order_placed": false
      }
   ]
}
Status: 400 Bad Request

{
    "error": "record_invalid",
    "error_description": "Invalid parameters",
    "error_attributes": {
        "quantity_per_grid": [
            "is missing",
            "is empty"
        ]
    }
}
Status: 404 Not Found

{ "error": "not_found", "error_description": "Not Found" }

Last updated

Was this helpful?