BTCUSDT.P Grid Bot - Long Strategy by 3Commas

By 3Commas

Performance Metrics

Description

BTC Grid Bot — Long Strategy🔷 What it does:This is a long-only price-grid strategy that harvests volatility on BTCUSDT.P through repeated round-trips on a pre-defined ladder of price levels between two fixed bounds. Each level is an independent slot: when price crosses down through a level, the strategy opens one slot; when price subsequently crosses up through the level immediately above, that slot is closed for a fixed round-trip profit. The grid is generated geometrically by default, so spacing adapts to BTC’s price scale.* Up to 50 simultaneous long slots at default settings, each sized as a fixed fraction of the configured Total Investment.* No trailing exit, no stop loss — each slot’s exit is the level above its entry.* Per-slot exposure is approximately 2.00% of equity at default settings.* Every fill and close emits a webhook-ready JSON alert payload tagged with the specific grid slot.🔷 Who is it for:* Swing traders harvesting volatility on BTC in range-bound regimes.* Bot operators looking for a chart-driven signal source with per-slot webhook JSON ready to drive a DCA Bot configured for grid execution.* Traders running a portfolio of low-correlation strategies who want a high-trade-count contributor with bounded per-slot exposure.* Range traders who prefer mechanical execution over discretionary entries.🔷 How does it work:Grid Construction: On script load, the strategy computes N price levels between the configured High and Low bounds. In Geometric mode, level k is at High × (Low/High)^(k/(N-1)), giving constant percent spacing — approximately 1.0% per step at default settings.Per-Slot Logic: Each grid level is an independent slot tracked by a boolean ownership flag. When bar close moves price down through an empty slot’s level, a long is opened at that level for one slot’s worth of capital. When bar close moves price up through the level immediately above an owned slot, that slot is closed.No Trailing, No Stop Loss: By design, each slot has a fixed exit: the level above. The strategy never trails the exit and never stops a slot out for a loss.Capital Bounds: Total deployed capital cannot exceed the configured Investment. When all 50 slots are filled, no new orders are opened until price rises and starts closing slots.🔷 Why it’s unique:* Per-Level Webhook Ledger: Every fill and close emits a fully-formed JSON alert payload tagged with the specific grid slot.* Pre-Allocated State: Up to 200 slot ledgers live in fixed-size arrays, allowing fast state tracking and clean chart rendering.* Honest Backtest Surface: Avg entry, open PnL, realized PnL, owned slots, and per-slot allocation are visible directly on the chart.* Calibrated for BTCUSDT.P 15m: Default bounds and level count are set for a broad BTC range, with a geometric ladder designed around ~1% steps.🔷 Considerations Before Using the Strategy:Market Selection & Range Validity: Grid strategies are most profitable in range-bound, mean-reverting markets. On strong directional moves below the configured Low, slots may remain open until price reverses.Capital Deployment & Drawdown: The default Investment of 10,000 USDT equals 100% of starting capital. Each slot uses approximately 200 USDT, or 2.00% of equity. Scale the Investment input down if you want lower aggregate exposure.No Stop Loss Justification: There is no exit on adverse moves below the lowest grid level. The strategy’s risk control is structural: fixed per-slot allocation and capped total investment.Trade Volume & Fees: BTC 15m grid execution can generate frequent round-trips. The ~1% step is designed to leave room for exchange fees and slippage.Demo Testing: Always demo-test before going live. Past results do not guarantee future performance.🔷 STRATEGY PROPERTIESSymbol: BTCUSDT.P — Bybit BTC perpetual contract.Timeframe: 15MTest Period: April 1, 2025 — June 7, 2026.Initial Capital: 10,000 USDT.Total Investment: 10,000 USDT.Order Size per Slot: Investment / 50 ≈ 200 USDT.Commission: 0.055% per trade.Slippage: 3 ticks.Margin for Long Positions: 100%.Grid Bounds: High 83,689.23 / Low 51,629.65.Grid Levels: 50.Spacing Mode: Geometric.Approx Step: ~1.0%.Stop Loss: None.Trailing: None.Strategy: Long Only.🔷 STRATEGY RESULTS⚠️ Remember, whole profit will be get at 82700 price tagNet Profit: +90.32 USDT (+0.90%)Max Equity Drawdown: 924.71 USDT (8.63%)Total Closed Trades: 428Percent Profitable: 60.51% (259 / 428)Profit Factor: 1.016🔷 How to Use It:🔸 Adjust Settings: Open the strategy inputs and set the High and Low bounds to a BTC range you expect the market to respect. Use Geometric spacing for percent-based grid levels.🔸 Results Review: Run a full-period backtest and confirm that Max Drawdown, trade count, and Profit Factor are acceptable for your risk profile.🔸 Create alerts to trigger the DCA Bot: Add one alert on the strategy using “Any alert() function call”. Paste your DCA Bot’s webhook URL into the alert’s Webhook field, and fill the Bot ID, Email Token, and Pair inputs on the script.🔷 INDICATOR SETTINGSHigh Price: Top of the grid.Low Price: Bottom of the grid.Grid Levels: Number of price levels between High and Low.Spacing Mode: Geometric or Arithmetic.Total Investment: Total capital allocated across all slots.Bot ID / Email Token / Pair: Webhook fields injected into every alert payload.Visualization: Toggle grid lines, range box, HIGH/LOW labels, avg entry plot, fill labels, status table, and watermark.👨🏻‍💻💭 We hope this tool helps enhance your trading. Your feedback is invaluable, so feel free to share any suggestions for improvements or new features you'd like to see implemented.__The information and publications within the 3Commas TradingView account are not meant to be and do not constitute financial, investment, trading, or other types of advice or recommendations supplied or endorsed by 3Commas and any of the parties acting on behalf of 3Commas, including its employees, contractors, ambassadors, etc.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView