Grid trading

Grid trading, and what to run instead

Grid trading places buy orders at set price levels below the market and sell orders at levels above it, so a bot buys dips and sells rallies while price stays inside a range. It earns in a sideways market and gets stuck when price trends out of the range. Keel can't run a grid, but it runs range strategies that buy oversold dips in coins still in an uptrend and sell the recovery, and you can backtest and fork them.

Ask AI about Keel
By Keel Research Team
Updated October 18, 2026
A range strategy from the library
Stochastic Oversold-Reversal (Crypto)
  • Each day, look at the 15 most traded Hyperliquid perps.
  • Buy a coin when its 10-day stochastic falls to 20 or below while price is above its 200-day average.
  • Sell when the stochastic climbs above 80.
  • Split the money equally across the coins it holds, with a cap on each one.
Sharpe
1.69
Return
+128%
Worst dip
−14%

Backtest on Hyperliquid, Aug 2024 to Sep 2026, after fees, slippage and funding.

Before you choose

What Keel does instead

You describe a rule, or let Keel's AI build it from blocks you can read. You backtest it on real Hyperliquid data with fees, slippage and funding, paper trade it on live prices, then run it on Hyperliquid perps from your own account.

A Keel strategy decides at the close of each bar it runs on. Stops, targets and adds are checked at that close too, never inside the bar. That rules out a few popular bot types, and the table says which.

Grid bots

Keel can't run a grid. A grid leaves limit orders waiting at fixed price levels and fills inside the bar. A Keel strategy can't place orders at levels it chooses; it decides at the close of each bar. It can run range strategies that buy dips and sell recoveries, and a ladder checked at each bar close.

What to run in a range instead

Arbitrage bots

Keel trades one venue, perps only, with no spot leg, so it can't arbitrage a price gap between exchanges. Funding carry is the nearest thing: a funding strategy on one venue, with real market risk.

Funding carry

Copy trading bots

Keel doesn't copy other traders. You run your own rule, after you have seen how it tested.

DCA bots

DCA on Keel means a safety-order ladder: add each time price drops a set amount, exit at a gain from the average price, checked at the bar close, on a perp that pays or earns funding. It doesn't buy on a schedule with new cash.

A DCA ladder you can fork

Signal, Telegram and exchange bots

Not supported. Keel doesn't sell signals, has no Telegram bot, and runs on Hyperliquid only.

The basics

What grid trading is

A grid bot works inside a price range you choose. You set a top and a bottom and how many levels to place between them. The bot rests a buy order at each level below the current price and a sell order at each level above it.

When price drops to a level, that buy fills and the bot places a sell one level higher. When price rises back to it, the sell fills and the bot books the gap between the two levels, then places a new buy below. Each round trip earns a small, fixed step. The more price swings back and forth inside the range, the more steps it books.

Levels can be spaced by the same amount of dollars or by the same percentage. Percentage spacing suits a coin that moves a lot, because the steps stay in proportion to the price. Either way, the grid needs no view on direction. It only needs price to keep crossing the same levels.

  1. 01

    Pick a range

    A top and a bottom where you expect price to stay. Too narrow and price leaves it quickly. Too wide and the levels sit far apart and rarely fill.

  2. 02

    Pick the levels

    How many orders to place between the top and bottom. More levels mean smaller steps, more trades and more fees.

  3. 03

    Let it trade the swings

    Every buy that fills waits for its sell one level up. The bot repeats this for as long as price stays inside the range.

The catch

Where grids lose: a trend breaks the range

A grid has no view on direction, which is its strength in a range and its weakness when the range ends.

Price falls through the bottom

Every buy order fills on the way down, and none of the sells above can fill. You end up holding the most of a coin that is still falling, bought at every level above the current price.

Price rises through the top

Every sell order fills on the way up, and the bot sits in cash while the coin keeps climbing. You booked small steps and missed the move.

Fees eat the steps

Each round trip earns one step and pays fees on two trades. Tight grids on a quiet coin can trade a lot and keep little.

Leverage on perps

A grid on perpetual futures also pays or earns funding, and with leverage a long run below the range can reach liquidation before price comes back.

What Keel runs instead

Range strategies you can backtest and fork

A range strategy aims at the same thing as a grid, buying weakness and selling strength, but it decides from indicators instead of fixed levels. The three below come from the Keel library. Each one only buys a dip while the coin is still in an uptrend, which is the part a grid leaves out: a grid keeps buying all the way down.

Stochastic Oversold-Reversal (Crypto)

Buys a coin when its stochastic falls into the oversold zone while price is still above its long-term average, and sells when the stochastic reaches the overbought zone.

Sharpe
1.69
Return
+128%
Max DD
−14%
RSI Oversold-Recovery Strategy (Crypto)

Buys a coin when its short RSI drops into oversold territory while the coin is still in an uptrend, and sells once RSI recovers to the middle.

Sharpe
1.02
Return
+34%
Max DD
−10%
Mean Reversion Strategy on Hyperliquid

On hourly bars, buys sharp washouts near or below the lower Bollinger band in coins still in an uptrend, and sells as price returns to its average.

Sharpe
0.23
Return
+4%
Max DD
−37%

All three are backtested over the same Hyperliquid history with the same costs. The same ideas are also tested across coins and timeframes on the Bollinger Bands page and the mean reversion page.

One of them in full: Stochastic Oversold-Reversal (Crypto)

1

The rules

  • Each day, look at the 15 most traded Hyperliquid perps.
  • Buy a coin when its 10-day stochastic falls to 20 or below while price is above its 200-day average.
  • Sell when the stochastic climbs above 80.
  • Split the money equally across the coins it holds, with a cap on each one.
2

The same rules, as blocks

Read it from the top. Daily prices come in. Two checks must both pass before a coin is bought: the stochastic is in its oversold zone, and price is above its long-term average. A separate check closes the trade when the stochastic reaches its overbought zone. The last blocks split the money equally. Switch to Code to see the same strategy as text.

Configuration

Globalsconfig
target_timeframe1dbar_offset12h
UniverseassetsTop by Volume · HL Perps · 15 assets15 resolved
Executionorders
rebalanceOn Change

Factories

trend_vs_200factory
Pipeline7 steps
PriceDataLoaderData Loader
ohlcvstore
Parallel2 branches
entry_setup
Parallel2 branches
oversold
StochasticIndicator
k_period10d_period3slowk_period3
BelowThresholdFilterSignal Transform
threshold20inclusivetrue
uptrend
trend_vs_200call
AboveThresholdFilterSignal Transform
threshold0
MaskAndSignal Composer
stoch_entrystore
exit_setup
StochasticIndicator
k_period10d_period3slowk_period3
AboveThresholdFilterSignal Transform
threshold80
stoch_exitstore
TradeManagerPosition Manager
entriesstoch_entrypricesohlcv
Parallel1 branches
stoch_overbought
stoch_exitload
ExitPosition Manager
ExposurePosition Manager
EqualWeightSizerPosition Sizer
target_leverage1max_weight0.2
3

The backtest

EquityDrawdown
Sharpe
1.69
Total return
+128.2%
Worst drawdown
−14.4%
Trades
74

Hyperliquid, Aug 2024 to Sep 2026, after trading fees, slippage and funding, on the default settings. It sits in cash most of the time, so the result comes from only 48 positions. Treat it as a hint about the idea, not proof.

Closest to a grid

A ladder checked at each bar close

The closest thing to a grid that Keel can run is a ladder checked at each bar close. The strategy opens a position, then adds another unit each time price closes a set step below the last fill, up to a limit you choose. It closes the whole position once price closes a set step above the average entry price.

That keeps the grid's habit of buying more as price falls and selling into a bounce. Two things differ. Orders go in at the close of the bar, not at a resting level, so in a fast move a fill can land well past the step. And the ladder sells everything at once at its target instead of one level at a time.

A ladder carries the same risk a grid does when price keeps falling: every add makes the position bigger. A stop or a trend filter on top is the usual answer, and you can see what each one does in a backtest before you run it.

The blocks it takes
  • TradeManager opens the trade from your entry rule.
  • ReturnSinceLastFill, a below-threshold check and ScaleIn add a unit after each step down.
  • ReturnFromAverage, an above-threshold check and Exit close it at the target.

We published this ladder as a DCA bot you can fork, with its backtest, on the DCA bot page.

FAQ

What traders ask about grid trading

Ask AI about Keel
What is grid trading?

A way of trading a range with orders at fixed price levels. A bot rests buy orders below the current price and sell orders above it, and books a small step each time price swings from one level to the next and back.

Is grid trading profitable?

It can be while price swings inside the range, and it loses when price trends out of it. A drop through the bottom leaves you holding the most of a falling coin, and fees take a share of every step. Whether a grid makes money depends on the range you pick and on what the market does next.

Does Keel have a grid bot?

Not a grid: a Keel strategy can't leave orders at set price levels, so it can't run one. Keel strategies decide at the close of each bar. It can run range strategies and a ladder that adds after each step down, both checked at the bar close.

What works better than a grid in a range?

Rules that buy dips only while the coin's trend is still up tend to avoid a grid's worst case, buying all the way down. The range strategies on this page do that with the stochastic, RSI and Bollinger bands. Whether they beat a grid on your coin is a question for a backtest.

Can I test a grid idea first?

On Keel you can backtest the closest version, a ladder that adds after each step down and exits at a gain from the average price, on Hyperliquid history with fees, slippage and funding. It fills at the bar close, so it won't match a grid order for order.

How realistic are these backtests?

Every Keel backtest charges trading fees and slippage on each trade and applies Hyperliquid's real funding to open positions. It is still a simulation, so paper trading on live prices is the next check. How Keel works explains the fill and cost model.

Test a range strategy on Hyperliquid

Fork one of the library's range strategies, change the coins or the levels, and backtest your version with real costs before anything trades.