Skip to main content

Gridbots

The Gridbot strategy in Gunbot focuses on automating trading through a grid of limit buy and sell orders. This approach is designed within a defined price range, offering a systematic method for executing trades.

Gridbots in action

Key Configuration Settings

The Gridbot strategy offers several configuration options to tailor the trading approach:

  1. Invest per Buy Order: This setting controls the investment amount for each buy order within the grid.

  2. Max Orders per Side: It defines the maximum number of orders that can be open on each side of the trade. For instance, a setting of 5 allows for up to 5 buy and 5 sell orders simultaneously.

  3. Rebalance: Activating this feature triggers the purchase of assets equal to the value of 'max orders' multiplied by 'invest per order' when the bot lacks sufficient assets to sell.

  4. Steps % for Gridbots: This option sets the percentage interval for creating the grid. If disabled, the grid size is automatically adjusted based on ATR (Average True Range).

Gridbots settings

Behavioral Overview of the Gridbot Strategy

Initialization

At the start, the Gridbot strategy performs a balance check. If the rebalance option is enabled and the asset balance is low, the bot conducts a market purchase to ensure enough assets for the desired number of sell grids.

Interval Calculation

The strategy calculates trading intervals using either a user-specified percentage or based on market volatility indicators.

Price Range Filtering

Gridbot identifies the lower and higher price points around the current market bid to establish the grid's boundaries.

Interval Adjustment

In response to significant market price movements, Gridbot recalculates intervals to maintain an effective grid structure.

Chart Target Management

The strategy provides a visual representation of bid and ask prices within the grid, enabling easy tracking on custom chart targets.

Order Execution and Management

Gridbot systematically places and manages buy and sell orders. It adheres to the set investment limit and adjusts orders as necessary, aligning with the grid's structure.

Gridbot settings

LabelConfig ParameterDefault ValueDetailed Description
Invest per buy orderTRADING_LIMIT20The base amount to invest for each individual buy order. For instance, setting this to 10 in a USDT-BTC pair means you will spend 10 USDT on each buy order.

This setting is crucial for managing how much you are willing to allocate to new positions.
Max invested baseMAX_INVESTMENT999999999999999Limits the total investment in the base currency. For example, setting 1000 in a USDT-BTC pair would limit the maximum investment to 1000 USDT.

This helps you cap your exposure to a single trading pair and manage risk effectively.
Funds reserveFUNDS_RESERVE0The amount of base currency that will not be traded. No more buy orders will be allowed once your available funds drop below this value.

This reserve acts as a buffer to ensure liquidity for other activities or to maintain a minimal balance.
Use rebalanceUSE_REBALANCEfalseWhen enabled, this feature triggers the purchase of assets equal to the value of 'max orders' multiplied by 'invest per order' if the bot lacks sufficient assets to sell. If disabled, the bot will only operate with the available balance.

This can be useful for maintaining trading activity and taking advantage of market conditions.
Steps %gbIntervalautoThis setting adjusts the percentage interval for creating the grid. For example, setting it to 1.2% establishes grids every 1.2%. If set to 'auto', the grid size is automatically adjusted based on the Average True Range (ATR) of the market.

This automatic adjustment helps optimize your grid strategy according to market volatility.
Max grid ordersMAX_GRID_ORDERS5Defines the maximum number of orders that can be open on each side of the trade. A setting of 5, for example, allows up to 5 buy and 5 sell orders simultaneously.

This setting helps manage the intensity of your trading activity and control the number of concurrent positions.
Stop lossSTOP_LIMIT99999Defines when to take losses. Setting this to 10 means all assets would be sold if their current value falls to 10% below the break-even price.

This setting is critical for managing risk and preventing significant losses during unfavorable market movements.
PeriodPERIOD15Sets which candles are used to display the chart and calculate ATR. This could be based on a time period like 15 minutes, 1 hour, etc.

Choosing the right period is essential for aligning your strategy with the intended trading frequency and market analysis.