Run a Grid-Trading Backtest
arena_run_grid_backtestWould a grid bot have made money here? Simulate a GRID BOT (buy-low / sell-high ladder inside a fixed price range) on historical candles. Returns final value, return %, CAGR, trade count, fees paid and a Buy & Hold comparison — plus zerlegung (spot runs): decomposition splits the result into ladder P&L from completed buy→sell cycles, allocation P&L of the starting coins, open grid buys and fees (identity_check_usd must be ~0); benchmarks anchors buy-and-hold, the never-touched starting split (static_allocation, with coin_share_start) and an arithmetic 50/50 at the entry price — grid_vs_static_pp is the number that says whether the ladder added anything over just holding the split; fee_economics gives the break-even spacing (2 × fee) and flags below_breakeven. Note: buyhold_return/outperformance keep their legacy anchor (first→last candle close); benchmarks anchor at entry. This is a different machine from the strategy backtester: grid bots earn from oscillation inside a range, not from trend — for signal-based strategies use arena_run_backtest instead. The result depends heavily on the range you choose (low_price / high_price); a range the price left early makes the bot idle (by default the grid pauses outside the range and resumes when price returns; set stop_on_range_exit to end the run at the first close outside it instead, selling all coins there), so treat range choice as part of the hypothesis, not a detail — arena_suggest_grid_range proposes a defensible range. Each run is saved to your account (the returned id is the run_id); publish a public snapshot page with arena_share_grid_backtest. grid_mode picks neutral (default) or long. Optional leverage (2/3/5, grid_mode long only, Pro) with funding_mode (conservative default / historical BTCUSDT / none): simulates an isolated-margin futures long grid — margin = total_investment, the grid trades margin × leverage, funding accrues daily on the open position, liquidation is checked per candle at the low. It simulates, it does not recommend: the result can be a total loss of the margin. Free tier limited to BTCUSDT/ETHUSDT. Per-day quota: Free=5, Pro=50, Power=500. [Free / Pro / Power tier]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pair | Yes | Crypto pair symbol, e.g. BTCUSDT. Free tier: BTCUSDT or ETHUSDT only. | |
| end_date | Yes | Simulation end, YYYY-MM-DD. | |
| fee_rate | Yes | Per-trade fee fraction, e.g. 0.001 for 0.1% (Binance spot taker). | |
| leverage | No | Optional, default 1 (spot grid, unchanged). 2/3/5 = isolated-margin long grid (grid_mode must be long; Pro). Adds liquidated, liquidation_time/price, funding_cost_usd and max_notional_exposure to the result; final_value/total_return are then on the margin. | |
| grid_mode | No | 'neutral' (default): buys coins for every level above the entry at the start (the coin share follows the entry's position in the range — measured 2–83 %, NOT a fixed 50/50; see benchmarks.static_allocation.coin_share_start), then buys and sells around the entry. 'long': starts 100% in cash, buys dips below the entry, sells on recovery — required for leverage. | |
| grid_type | Yes | Level spacing: 'arithmetic' = equal price steps, 'geometric' = equal percentage steps (usually the better fit for crypto). | |
| low_price | Yes | Lower bound of the grid range, in quote currency. Below it the bot is fully invested and stops buying. | |
| grid_count | Yes | Number of grid levels between low_price and high_price (2–200). More levels = more, smaller trades = more fees. | |
| high_price | Yes | Upper bound of the grid range, in quote currency. Above it the bot is fully in cash and stops selling. Must exceed low_price. | |
| start_date | Yes | Simulation start, YYYY-MM-DD. | |
| entry_price | No | Optional price at which the bot starts; default is the OPEN of the first candle (must lie inside low_price..high_price). | |
| funding_mode | No | Only with leverage > 1. 'conservative' (default): flat 0.05%/day on the open position. 'historical': recorded daily average of three exchanges, BTCUSDT from 2019-09-08 only — otherwise falls back to conservative and flags funding_fell_back_to_conservative. 'none': no funding (optimistic). | |
| stop_loss_price | No | Optional: liquidate the whole grid and stop once price falls to this level. | |
| total_investment | Yes | Capital in USDT spread across the grid; min 100. | |
| take_profit_price | No | Optional: liquidate the whole grid and stop once price rises to this level. | |
| stop_on_range_exit | No | Optional (default false): stop once a candle CLOSES outside low_price..high_price — sell all coins at that close, stop_reason range_exit_high/low. Default: the grid pauses outside the range and resumes when price returns. |