Strategies

Grid Spacing: How to Set the Gap Between Grid Levels

Grid spacing decides how often a grid bot trades and how much each fill earns. Learn to set the gap between grid levels using volatility, fees, and range width.

July 17, 2026·3 min read
Diagram of grid trading levels with a caliper measuring the spacing between two rungs on a sideways price line.

What grid spacing actually controls

A grid bot places a ladder of buy and sell orders across a price range, buying each step down and selling each step up. Grid spacing is the gap between those rungs — and it's the setting that decides everything else.

  • Tight spacing = many small trades, more fills, thinner profit per fill.
  • Wide spacing = fewer trades, bigger profit per fill, more idle time.

The right gap isn't a magic number. It's a balance between how much the market moves, what your broker charges, and how wide your range is.

Side-by-side comparison of tight grid spacing with many rungs versus wide spacing with few rungs.

Start with volatility, not a round number

The market's natural wiggle should set your spacing. If price routinely swings 1% in an hour, grid levels spaced 0.2% apart will fill constantly; levels spaced 3% apart may never trigger in a quiet week.

A practical anchor is recent volatility — how far price typically travels over your chosen timeframe. The gives you exactly this: an average range you can use as a reference unit. Spacing each rung a fraction of ATR apart keeps the grid tuned to how the instrument actually behaves rather than an arbitrary percentage.

Grid spacing should breathe with the market, not fight it. Levels that match real volatility fill at a healthy rhythm; levels that ignore it either spam trades or sit dead.

Every fill has to clear fees first

Here's the trap that quietly kills tight grids: each round trip pays fees twice — once buying, once selling. If your spacing is 0.15% but your broker takes 0.1% per side, the trade is already underwater before price moves.

Your minimum viable spacing is roughly:

ComponentExample
Buy fee0.1%
Sell fee0.1%
Fee floor per round trip0.2%
Target net profit per fill0.2%
Minimum spacing~0.4%
Warning

A grid that looks profitable in theory can bleed on fees alone. Always subtract both sides of the commission before deciding a gap is "wide enough." On crypto, funding on futures grids adds another cost layer.

Choosing limit orders for grid fills helps here — they often earn maker rebates or lower fees than market orders. If that distinction is new, see .

Bar diagram showing a grid trade's profit sliver squeezed between buy-side and sell-side fees.

Match spacing to your range and grid count

Spacing, range width, and number of levels are locked together — pick any two and the third is fixed. Divide your range by the number of grids to get spacing, or divide range by spacing to get grid count.

A workable process:

  1. Define the range. Identify the support and resistance boundaries where the market has been oscillating.
  2. Set spacing from volatility and fees. Use ATR as a unit; confirm the gap clears your fee floor with room to spare.
  3. Derive the grid count. Range ÷ spacing = number of rungs. More rungs need more capital, since each level holds a position.
  4. Sanity-check capital per level. Total budget ÷ grid count should still be a meaningful order size at your broker's minimum.
Tip

With algomax you don't calculate any of this by hand or touch code. You describe the range, spacing logic, and budget in plain language, and the assistant turns it into a ready-to-run bot you can backtest before going live.

Grids assume the market keeps ranging. A strong trend can walk price out of your bounds and leave you holding a stack of buys — so pair any grid with a plan for what happens when the range breaks.

Key takeaways

  • Grid spacing sets the trade rhythm: tight = frequent small fills, wide = rare bigger fills.
  • Anchor spacing to volatility (ATR works well), not a round percentage.
  • Clear both fee legs plus a profit margin before calling a gap wide enough.
  • Spacing, range, and grid count are linked — set two, the third follows, and check capital per level.

Keep reading

Essentials

API Key Permissions: Never Grant Withdrawal Access

The single most important setting when you connect a broker to a trading bot is what the API key is allowed to do. Get the permission scopes right and a leaked key can't drain your account.

Jul 16, 2026·4 min read
Markets

Forex Session Timing: When Automated Bots Should Trade

The forex market never sleeps on weekdays — but that doesn't mean your bot should trade every hour. Here's how session timing shapes volatility, spreads, and when an automated OANDA strategy actually has an edge.

Jul 15, 2026·4 min read
Grid Spacing: How to Set the Gap Between Grid Levels · AlgoMax AI