Skip to content

Protections: out of range, crash, margin, liquidation

A Grid bot regularly checks the price, the position and the orders, and in emergencies it pauses itself or closes. The protections are always on and cannot be configured, but they do not replace a Stop-Loss, a moderate leverage and a wide range.

How it works

ProtectionWhen it firesWhat the bot does
Out of rangethe price is more than 2 % beyond the bound and has moved more than 5 % from the middle of the range; checked about every 3 minutesa soft pause, the orders stay; the status “Out of range (above)” or “Out of range (below)”
Automatic returnthe price is strictly inside the range; checked every 60 secondsthe bot resumes by itself
Crash protection80 % or more of all levels are already in position (for Long — bought); checked about every 3 minutes; works on spot as wella hard pause: all orders are removed, the sells included; the exit from the position comes after ▶️ Resume
Margin overload (futures)the used margin of the whole account reached 80 % of its capitala forced stop: the orders are cancelled, the position is closed at market, the status is “Closed”
Closeness to liquidation (futures, leverage above 1)less than 15 % is left to the real liquidation pricethe same forced stop
Position control (futures)the position on the exchange is smaller than the expected one: closed or reduced outside the bot; checked about every 3 minutesthe exit orders are resized to the real position; when it is zero — the levels are released, the entry orders keep working
Exit restoreda level with a position has no sell order (for example, it was removed by hand) for two checks in a row, about 10 minutesthe exit order is placed again
Series of errors3 permanent refusals of the exchange in a row: not enough balance, a wrong lot, a keya soft pause; after the cause is removed — ▶️ Resume
Order reconciliationevery 5 minutes the number of orders on the pair does not match the expected onethe missing ones are placed again; the extra ones are not touched
Safety stop (futures)every 60 seconds, during a pause as wella stop 0.5 % before the liquidation price; visible in Bybit → Positions → TP/SL, it is not your SL

Account events: a change of the position mode on the exchange — a hard pause, “🚨 Position mode changed on the exchange” (see Position mode changed); a pair being delisted — a pause with “paused by the system”, and a full stop a day before the delisting; the kill switch — a hard pause of all running Grid bots (see Kill switch).

What the bot sends

Pauses and closes caused by the protections arrive immediately, in any notification mode:

  • “⏸️ BTC grid (BTCUSDT) Grid bot paused. Reason: price 67500 went above the range (top 66000). Orders stay on the exchange; the bot resumes by itself when the price returns to the range, or recreate the grid” — there is no ▶️ Resume button in this status.
  • “⏸️ … Reason: crash protection: 4 of 5 levels are already in position. All orders were removed, the position is open — check the market and tap 'Resume'”.
  • “🔒 … Grid bot closed: used account margin 82 % reached 80 %. Orders cancelled, position closed at market. Total PnL: -4.10 USDT” — the same for “less than 15 % left to the liquidation price (liquidation ≈ 52000, price 59500)”.
  • “⚠️ … The position for this pair was closed on the exchange outside the bot (expected 0.005, on exchange 0). Exit orders were removed, levels released, entry orders keep working. If this was not you, check your account.” — see Position closed outside the bot.
  • “🔁 … The SELL exit order at level 60600 was cancelled on the exchange outside the bot — placed again.”
  • “⏸️ … Reason: 3 consecutive order placement errors (last: …). Check the balance, API keys and settings, then tap 'Resume'”.

Example with a calculation

A Long grid 60,000 — 66,000, the middle of the range is 63,000.

PriceBeyond the boundFrom the middleResult
67,00067,000 / 66,000 = +1.5 %+6.3 %no pause needed: less than 2 % beyond the bound
67,500+2.3 %+7.1 %both conditions are met — “Out of range (above)”
65,900 after the pauseinsidethe automatic return within a minute

Crash protection: in a grid of 5 levels 4 are bought — that is 80 %, the bot removes all orders and waits for your decision; in a grid of 20 levels it takes 16 bought levels.

Limits and allowed values

ParameterValue
Out-of-range threshold2 % beyond the bound and 5 % from the middle
Crash protection threshold80 % of the levels in position
Margin overload80 % of the account capital
Closeness to liquidationless than 15 %
Series of errors3 refusals in a row
Safety stop0.5 % before the liquidation

Common mistakes and what the bot says

  • Manual orders on the same pair from the same keys break the order reconciliation — trade the bot's pair only through the bot.
  • You removed a buy order by hand — it is not restored, the level stays empty; the bot brings a sell order back within about 10 minutes.
  • “🔒 … used account margin…” on a bot with a small leverage — check the other positions on the same account: the margin is counted across the whole account.