Skip to main content

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.

tip

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:

Typical spotgrid trades. Green arrows are buys, orange arrows are sells.

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:

Slowly accumulating with same sized orders

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.

tip

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

LabelConfig ParameterDefault ValueDetailed Description
Trading limitTRADING_LIMIT20Base amount of USDT to invest per buy order in a pair like USDT-BTC. Adjust to match your per-trade allocation.
Max buy countMAX_BUY_COUNT40Maximum number of open positions before the strategy switches to sell-only mode. This is a multiple of the trading limit.
Min volume to sellMIN_VOLUME_TO_SELL10Minimum order value (USDT) that can be sold. Align with your exchange's minimum order size.
Max invested baseMAX_INVESTMENT999999999999999Cap on total investment in USDT for the pair to prevent overexposure.

Customize targets

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD15Time period of candles used to calculate auto steps and trailing ranges. Lower values increase trading frequency and risk.
Auto gainAUTO_GAINTrueDynamic profit target based on support/resistance distance, with a minimum of twice trading fees. Overrides manual gain.
GainGAIN0.5Fixed profit target (%) above break-even. A sell triggers when price exceeds this threshold.
Grid multiplierGRID_MULTIPLIER1Spacing between buy orders. Values above 1 widen spacing; values below 1 tighten spacing.

Advanced

LabelConfig ParameterDefault ValueDetailed Description
Stop after next sellSTOP_AFTER_SELLFalseStops trading once all current holdings are sold.
Buy enabledBUY_ENABLEDTrueControls whether buy orders can be placed.
Sell enabledSELL_ENABLEDTrueControls whether sell orders can be placed.
Unit costunit_costTrueCalculates break-even using average cost per unit remaining instead of the full order sequence.
SMA periodSMAPERIOD50Number of candles used to calculate support/resistance for buydown targets and trailing ranges.
Keep quoteKEEP_QUOTE0Amount of quote currency (e.g., BTC) to keep and not sell.
Ignore trades beforeIGNORE_TRADES_BEFORE0Timestamp (ms) before which trades are ignored, useful for restarts.
tip

Other parameters

Watch mode is respected.

Besides settings mentioned on this page, no other strategy setting has any effect on spotgrid.