SpotGrid Trading Strategy
A grid-like strategy with dynamic trading targets and integrated trailing for buying and selling.
SpotGrid is always in position: it uses market orders, averages down as price drops, and takes profit once price moves above break-even, all with a minimal set of settings.
SpotGrid differs from other Gunbot strategies: there are only a handful of options and it is always in position. Instead of waiting for a perfect entry, it keeps looking for opportunities to average down.
If you want heavy customization, this strategy is not for you.
Trading behavior
When you run spotgrid on a pair in an uptrend, this is the kind of trading behavior to expect:

Let's break down what happens:
- When the strategy first runs and there is no balance to sell, it immediately places a market buy order.
- If price goes down and exceeds the SpotGrid line in the chart, buy trailing is activated. When trailing finishes, a buy order is placed and the break-even price drops.
- If price reaches the Sell target on the chart, sell trailing is activated and the complete position is sold at profit when trailing finishes.
- After selling, the strategy immediately starts buy trailing. If price goes up it will quickly open a new position; if price goes down it will place a buy order below the last sell rate.
The first few buy orders happen quickly when price starts dropping. After a few trades, the distance between buy orders grows. All targets are set automatically.
When the market goes down, the strategy accumulates units at lower prices:

The bot continues to accumulate until max buy count is hit or it runs out of available funds. Each new buy order lowers break-even. As soon as price hits the sell target and finishes trailing above break-even, a sell order is placed.
Balance management is important; make sure you can afford the planned number of buy orders.
The next trading targets are always visible on the chart.
Keep in mind the target lines move over time; they represent the current targets.
SpotGrid settings
Balance settings
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| Trading limit | TRADING_LIMIT | 20 | Base amount of USDT to invest per buy order in a pair like USDT-BTC. Adjust to match your per-trade allocation. |
| Max buy count | MAX_BUY_COUNT | 40 | Maximum number of open positions before the strategy switches to sell-only mode. This is a multiple of the trading limit. |
| Min volume to sell | MIN_VOLUME_TO_SELL | 10 | Minimum order value (USDT) that can be sold. Align with your exchange's minimum order size. |
| Max invested base | MAX_INVESTMENT | 999999999999999 | Cap on total investment in USDT for the pair to prevent overexposure. |
Customize targets
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| Period | PERIOD | 15 | Time period of candles used to calculate auto steps and trailing ranges. Lower values increase trading frequency and risk. |
| Auto gain | AUTO_GAIN | True | Dynamic profit target based on support/resistance distance, with a minimum of twice trading fees. Overrides manual gain. |
| Gain | GAIN | 0.5 | Fixed profit target (%) above break-even. A sell triggers when price exceeds this threshold. |
| Grid multiplier | GRID_MULTIPLIER | 1 | Spacing between buy orders. Values above 1 widen spacing; values below 1 tighten spacing. |
Advanced
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| Stop after next sell | STOP_AFTER_SELL | False | Stops trading once all current holdings are sold. |
| Buy enabled | BUY_ENABLED | True | Controls whether buy orders can be placed. |
| Sell enabled | SELL_ENABLED | True | Controls whether sell orders can be placed. |
| Unit cost | unit_cost | True | Calculates break-even using average cost per unit remaining instead of the full order sequence. |
| SMA period | SMAPERIOD | 50 | Number of candles used to calculate support/resistance for buydown targets and trailing ranges. |
| Keep quote | KEEP_QUOTE | 0 | Amount of quote currency (e.g., BTC) to keep and not sell. |
| Ignore trades before | IGNORE_TRADES_BEFORE | 0 | Timestamp (ms) before which trades are ignored, useful for restarts. |
Other parameters
Watch mode is respected.
Besides settings mentioned on this page, no other strategy setting has any effect on spotgrid.