Gridbots Spot Trading Strategy
The Gridbot strategy in Gunbot automates trading through a grid of limit buy and sell orders within a defined price range.

Key Configuration Settings
The Gridbot strategy offers several configuration options to tailor the trading approach:
Invest per Buy Order: Controls the investment amount for each buy order within the grid. Adjust to match your risk and exposure preferences.
Max Orders per Side: Sets the maximum number of open orders on each side. For example, 5 allows up to 5 buy and 5 sell orders simultaneously, helping manage risk.
Rebalance: When enabled, the bot buys assets equal to max orders times invest per order if it lacks assets to sell. This provides inventory to keep the grid active.
Steps % for Gridbots: Sets the percentage interval for the grid. If disabled, the grid size is based on ATR (Average True Range) so it adapts to volatility.

Behavioral Overview of the Gridbot Strategy
Initialization
At startup, Gridbot checks balances. If rebalance is enabled and asset balance is low, it makes a market purchase to ensure enough assets for the desired number of sell grids.
Interval Calculation
Intervals are calculated using a user-specified percentage or ATR-based volatility. This lets you choose manual control or automatic adjustment to market conditions.
Price Range Filtering
Gridbot identifies lower and higher price points around the current bid to define grid boundaries, keeping the grid aligned with current price action.
Interval Adjustment
When price moves significantly, Gridbot recalculates intervals to maintain an effective grid and avoid gaps.
Chart Target Management
The strategy shows bid and ask prices on custom chart targets, making it easier to track the grid in real time.
Order Execution and Management
Gridbot places and manages buy and sell orders according to the grid. When a buy fills, the corresponding sell order is placed automatically, keeping the grid active.
Advanced Features for Gridbot Users
Auto Step Size Adjustment
Gridbot can adjust grid step size automatically based on market conditions, helping the grid remain effective in high volatility or low liquidity.
Partial Sell and Profit Taking
Partial sell orders allow profits to be taken gradually as the market moves in your favor, reducing exposure to sudden reversals.
Risk Management Tools
Gridbot includes risk management options such as stop-loss and trailing stop features to limit potential losses and lock in gains.
Gridbot settings
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| Invest per buy order | TRADING_LIMIT | 20 | Base amount to invest per buy order. Example: 10 in USDT-BTC spends 10 USDT per buy. |
| Max invested base | MAX_INVESTMENT | 999999999999999 | Cap on total base currency invested. Example: 1000 in USDT-BTC caps investment at 1000 USDT. |
| Funds reserve | FUNDS_RESERVE | 0 | Amount of base currency reserved and not traded. No new buys once available funds drop below this value. |
| Use rebalance | USE_REBALANCE | false | When enabled, buys assets equal to max orders times invest per order if balance is insufficient. If disabled, trades only with available balance. |
| Steps % | gbInterval | auto | Percentage interval for grid steps. Example: 1.2% sets grids every 1.2%. Auto uses ATR. |
| Max grid orders | MAX_GRID_ORDERS | 5 | Maximum number of open orders per side. Example: 5 allows up to 5 buy and 5 sell orders. |
| Stop loss | STOP_LIMIT | 99999 | Defines when to take losses. Example: 10 sells assets if value drops 10% below break-even. |
| Period | PERIOD | 15 | Candles used to display the chart and calculate ATR (e.g., 15 minutes, 1 hour). |