Ready to go further
See your own grid, level by level
Enter a range, a number of grids and an order size, and see each level and the capital it needs.
What is included
- How the bot works, step by step
- The arithmetic of the ladder or grid, with tables
- How it fails and how to test it honestly
- The tools that check the numbers
Who it is for
- People thinking of using this kind of bot
- People already running one and wanting a stress test
- Readers comparing bot types before buying
- Not advice, and not a recommendation to use one
Key facts
- A grid trading bot places a ladder of buy and sell orders at fixed price steps inside a range and repeats them as price moves up and down.
- Its core settings are the lower price, the upper price, the number of grids, the order size and the spacing. Everything else follows from those five.
- In a made-up example with a step of 5, a buy at 70 sold at 75 returns 7.14 on 100 (7.14 percent) before fees.
- In a steady fall the bot keeps buying. After four buys of 100 it holds 5.9670 units at an average cost of 67.03, and with price at 55 the unrealised result is -71.81 (calculated by us on 27 Oct 2026, exact).
- The bot does not fail in a range. It fails when price leaves the range and does not return.
How a grid trading bot is built
A grid bot is a small set of rules around one idea: sell a little higher than you bought, many times. You give it a price range. It cuts the range into equal steps and puts a buy order at each step below the current price and a sell order at each step above it. When a buy fills, the bot places a sell order one step higher. When that sell fills, it places the buy again. Each pair is one completed cycle, and the bot keeps cycling while price stays inside the range.
The general idea is covered on grid trading and the choice of spacing on grid trading strategy. This page is about the bot itself: the settings it needs, what each one controls, and the exact way it fails in a trend.
The settings
These are the settings every grid bot asks for, with made-up values used in the rest of this page.
| Setting | Made-up value | What it controls |
|---|---|---|
| Lower price | 60 | The bottom of the range. Below it the bot places no more buy orders. |
| Upper price | 100 | The top of the range. Above it the bot has nothing left to sell. |
| Number of grids | 8 | Price steps in the range. Here the step is (100 - 60) / 8 = 5. |
| Order size per level | 100 | The amount spent at each buy level. Equal sizes in this example. |
| Spacing | Arithmetic | Equal price gaps. Geometric spacing uses equal percent gaps instead. |
| Stop and take-profit price | None set | Optional. Without them the bot keeps holding whatever has filled. |
Some bots add a stop price, a take-profit price or a trailing range that moves with price. Those are options on top of the grid, and each one changes how the bot behaves at the edge. A bot with no stop simply holds what it has bought.
What one completed cycle earns
The earning in a grid is small and mechanical. Take the made-up setting above. Price falls to 70, the bot buys 100 worth, which is 1.4286 units. Price rises to 75 and the bot sells those units for 107.14. The gain is 7.14, or 7.14 percent of the 100. The same step is a smaller percent at a higher price and a larger percent at a lower one, which is why equal-gap grids behave a little differently at the top and bottom of the range.
That figure is before costs. Every fill pays a fee, and on some venues a spread as well. A step that looks like 7.14 percent can be mostly eaten by fees if the step is narrow. The page on grid bot fees and costs works through it, and the grid calculator lets you try your own numbers.
The exact way a grid bot fails in a trend
Now the other case. Price does not bounce between 60 and 100. It starts at 80 and falls and keeps falling. This is how the bot reacts, step by step.
- At 75 the first buy fills. The sell order one step up is at 80. Price does not get back there.
- At 70, 65 and 60 the next buys fill. Each one adds a position, and none of them is sold, because price never rises a step from any of them.
- Below 60 the bot has no more buy orders. It simply holds everything it bought.
The table shows the position as each buy fills, with the unrealised result measured when price reaches the next level down (55 after the last buy).
| Buy at | Units bought | Total units | Total spent | Average cost | Price now | Value of holding | Unrealised result |
|---|---|---|---|---|---|---|---|
| 75 | 1.3333 | 1.3333 | 100.00 | 75.00 | 70 | 93.33 | -6.67 |
| 70 | 1.4286 | 2.7619 | 200.00 | 72.41 | 65 | 179.52 | -20.48 |
| 65 | 1.5385 | 4.3004 | 300.00 | 69.76 | 60 | 258.02 | -41.98 |
| 60 | 1.6667 | 5.9670 | 400.00 | 67.03 | 55 | 328.19 | -71.81 |
The pattern is the point. The bot is never wrong in any single step. Each buy was placed exactly as designed. But the sell orders only fill if price rises, so in a one-way fall the bot ends up fully invested at the bottom of its range, with the largest position when price is lowest. Its average cost of 67.03 is above the price of 55, so the position is down 71.81 on 400.00 spent, 17.95 percent. The little cycle gains earned earlier are small next to that. Calculated by us on 27 Oct 2026, exact.
The mirror image happens in a rise. Once price goes above the top of the range, every sell order has filled, the bot holds nothing, and it earns nothing more however far price goes. It does not lose in that case. It simply stops taking part.
Settings that change how it fails
- Range width. A wider range survives bigger moves but spreads the same money over more levels, so each order is smaller and each step earns less.
- Number of grids. More grids mean smaller steps and more cycles, and more fee drag per cycle. Fewer grids mean larger steps and fewer fills.
- Leverage or margin. On a margin product the held position can be liquidated before price reaches the bottom. See futures grid liquidation.
- A stop price. It caps the loss and ends the bot, and it turns an unrealised loss into a real one.
How to check a grid bot before trusting it
- Look at the largest position the test ever held and the biggest unrealised loss, not only the final result.
- Test through a clear trend, up and down, with fees and spread included on every fill.
- Ask what the bot does after price leaves the range: does it stop, hold, or move the range?
- Read the are grid bots profitable page for what the maths can and cannot say.
No result from a bot of our own is published on this page. Every price here is made up to show the arithmetic.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
What is a grid trading bot?
A bot that places buy and sell orders at fixed price steps inside a range, and replaces each order when it fills. It aims to collect the small gap between each buy and the sell one step above.
What settings does a grid trading bot need?
A lower price, an upper price, a number of grids, an order size and a spacing type. Many also offer a stop price and a take-profit price.
What happens to a grid bot in a downtrend?
It keeps filling buy orders as price falls and the sell orders do not fill. It ends fully invested near the bottom of the range with an unrealised loss, and buys no more below it.
What happens to a grid bot in an uptrend?
Its sell orders fill one by one until it holds nothing. Above the top of the range it earns nothing more, though it has not lost anything either.
Does a stop price fix the problem?
It limits how far the loss can go, but it makes the loss real and ends the bot. It does not change the fact that the bot was filled all the way down.
Are the numbers on this page real?
Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.
Can I use this to decide whether to run a bot?
It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.
Is this financial advice?
No. It is general education about how a type of bot works. All prices are made up, and it does not consider your situation.
Know the Risk Before You Run It
Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.
Trading carries a risk of loss