Grid bot range and density: how to choose them, with fees and backtest
Two choices decide most of a grid bot's outcome: where the range sits and how densely it is cut. Pick the range wrong and the price leaves it. Cut it too finely and fees eat every trade. This guide shows how to choose both and how to check the choice with the backtest and the Optimize tool.
1. Choose the range from the chart
The range is the price band the bot trades inside. Use the chart in the builder: it opens with 500 candles of 1 hour (about three weeks) and has buttons for 200, 500 and 1000 candles. Look for the band the market has actually spent its time in, not the band you hope it will visit. The Low and High lines on the chart can be dragged, and the boxes follow.
- Too narrow: the price leaves quickly. Below the range you hold coin that lost value, above it you have sold everything and earn nothing.
- Too wide: the money is spread thinly, each grid earns little in percent terms, and the price may never cross most of the lines.
The Levels down / up slider moves the whole range around the live price without changing the number of levels or the step, which is a quick way to ask "what if I put more of the ladder above the price?".
2. Geometric or arithmetic
- Geometric: every step is the same percentage. A 1% step is 1% whether the price is low or high in the range, so each completed grid earns the same percentage. Good for wide ranges.
- Arithmetic: every step is the same distance in price. The same gap is a larger percentage near the bottom and a smaller one near the top. Simple, and fine for narrow ranges.
3. Profit per grid and Grids
Two boxes describe one decision. Profit per grid is the percentage distance between neighbouring lines. Grids is the number of intervals between Low and High, so five lines make four grids. Type either one and the other is filled in from the server's calculation.
A worked example, for illustration only: take a range of 90,000 to 100,000 with a geometric ladder. Ten grids give a step of about 1.06%. Twenty grids give about 0.53%.
4. The fee rule
A grid trade has two fills, so it pays the fee twice. At 0.10% per fill a round trip costs about 0.20%. In the example above, ten grids leave about 0.86% per completed trip, but twenty grids leave only about 0.33%, and fees take a much bigger share. A step smaller than the round-trip fee loses money on every trade.
The form helps in three places. The hint beside Profit per grid shows the smallest step that is accepted. A line under the boxes says what one trip nets after fees. And a small note names the fee in use and where it comes from: a rate seen on your own fills, the exchange's published rate, or an assumed default when nothing is known. If it says assumed, check your real fee.
5. Money per grid
The amount per trade is roughly the investment divided by the number of grids. With 1,000 USDT and ten grids, each order is around 100 USDT. More grids mean smaller orders. Smaller orders can fall below the exchange's minimum order size, and the form warns you in red with the minimum investment for that number of grids.
6. Backtest it
The Backtest button replays your exact settings on past prices. You choose:
- Period: 7 days to 3 months (30 days by default).
- Candle size: automatic, or a size you pick. A candle can fill a grid only once however far the price moved inside it, so a coarse candle can show fewer trades than a fine one for the same month.
- Replay model: how each candle is walked, which also changes the number of fills.
The result shows the profit as a percentage of the money the ladder ties up, the number of trades and closed grids, realised and unrealised profit, fees paid, grids still open at the end, and a P/L curve. Look at the curve. A month that climbs steadily and a month that spiked and gave it all back can end on the same number. It also lists the peak, the worst point and the deepest give-back, and a transaction log with a short tag on each fill (for example OL for open long and CL for close long).
If the price left the range in the test, the report says for how many candles it was below or above it. That is the number to look at before you trust a profit figure.
7. Optimize
Under the density boxes, Optimize replays the same window at a dozen densities and ranks them. Clicking a row writes that density into the boxes. It uses the same period, candle size and replay model as the Backtest panel, so the ranking and the report are measured the same way.
A warning about backtests
The best density on last month's prices is the best at fitting last month. It is not a promise about next month. Prefer a density that is good across several windows over one that wins a single window by a small margin, keep a clear margin above fees, and run Demo before Real. Backtest and Demo results do not guarantee future results.