[3Commas] Static Geometric Grid β€” Strategy by 3Commas

By 3Commas

Performance Metrics

Description

[3Commas] Static Geometric GridπŸ”· What it does:This strategy implements a static geometric grid trading system, designed for instruments expected to oscillate within a defined range. It pre-computes 64 price levels between a configurable High and Low boundary using geometric spacing (β‰ˆ 0.61% step), buys at each level on close-cross-down, and sells at the next level up on close-cross-up. Unlike adaptive grid variants with trailing logic, this version stays locked to the original range β€” no auto-shift up or down. Profit comes from capturing the spread between adjacent grid lines on every oscillation; losses occur when price exits the range and filled levels remain underwater until reversal. - 64 geometrically-spaced levels between Low (0.10591) and High (0.15466) - Buy on close-cross-down through an unfilled level; sell on close-cross-up through the next level - Fixed notional per level (24.15 USDT default), all fills equally sized - No trailing up β€” grid stays locked to the configured range - No stop loss β€” positions held until matching sell level is hitπŸ”· Who is it for: Range-bound market specialists who identify ranging instruments and want to monetize the oscillations. Bot operators who automate grid execution through webhook integration with a connected bot. Traders who prefer predictable risk envelopes β€” the static range defines exact worst-case accumulation. Spot traders with a strong directional view that the instrument will remain inside the configured boundaries.πŸ”· How does it work: Long Entry: When close crosses down through an unfilled grid level, the strategy opens a long position sized to the per-level notional amount. Each level is independent β€” multiple buys can stack across the ladder simultaneously, creating the grid accumulation effect during downtrends. Short Entry: Not used β€” this is a long-only spot grid. Exit Management: For each filled level, the strategy places a limit exit at the next level up. When close crosses up through that target, the position closes and the level becomes available to buy again. No stop loss is used; the grid's Low boundary defines the structural worst-case accumulation point. Static range β€” the grid does NOT shift when price exits the boundary. If price breaks above High, the strategy stops opening new buys until price returns. If price breaks below Low, all 64 levels are filled and the position holds unrealized loss until either the average is recovered or the user closes manually.πŸ”· Why it's unique: Pure static range β€” most grid implementations include trailing-up to follow trends, which compromises the original risk envelope. This variant stays locked to the configured range, which gives a predictable worst-case scenario: maximum unrealized loss is bounded by (Current Price βˆ’ Grid Low) Γ— Total Position. Traders know exactly what they are signing up for. Geometric distribution β€” constant percentage step across the entire range (β‰ˆ 0.61% per step in default config) rather than constant absolute spacing. This is structurally fairer when the instrument is far from zero and is the same model used by professional grid bots. Bot Integration β€” entry and exit alerts ship with webhook-ready JSON payloads. The grid_start alert fires on first activation. Bot ID, Email Token, and pair label are exposed as inputs.πŸ”· Considerations Before Using the Indicator: Market & Timeframe: This strategy is highly timeframe-sensitive and is calibrated for a 15-minute chart. Fill density depends directly on how often close crosses grid levels. Higher timeframes (1h+) produce far fewer fills; lower timeframes (1m, 5m) generate more fills but slow backtests. The runtime warning label flags any TF other than 15m. Limitations: No stop loss and no trailing range adjustment. The strategy is structurally exposed to two failure modes: (1) Price breaks above High β€” strategy idles, no new fills until reversal back into range (2) Price breaks below Low β€” all 64 levels fill, unrealized loss accumulates until average is recovered or position is manually closed This is the trade-off of a pure static grid: predictable risk envelope, but no adaptive protection against trend breakouts. Pair this strategy with manual range validation and an exit plan before deploying capital. Backtesting & Demo Testing: Always validate the grid range and step size on historical data for the specific instrument. Each pair has a different volatility profile, and the optimal grid parameters vary accordingly. Re-test on your own venue using venue-specific commission and slippage. Demo-trade for at least one month before any live deployment. Past performance is not indicative of future results. Parameter Adjustments: Commission defaults to 0.10% (Bybit spot taker). Adjust for your venue β€” OKX Spot ~0.08%, Binance Spot ~0.10%, Coinbase Advanced ~0.50%. Slippage of 2 ticks is conservative for liquid pairs β€” increase for thin order books. Grid range and level count should be re-tuned per instrument volatility; wider ranges and more levels for higher-volatility assets.πŸ”· STRATEGY PROPERTIES Symbol: OKX:APEUSDT (ApeCoin/USDT Spot). The strategy is generic and runs on any spot pair β€” APE is the reference instrument. Timeframe: 15m chart (mandatory β€” strategy is calibrated for this TF). Test Period: Jan 12, 2026 β€” May 14, 2026 (β‰ˆ 4 months). Initial Capital: 2,000 USDT. Order Size per Trade: 24.15 USDT per grid level. Total investment envelope β‰ˆ 1,545.84 USDT (64 levels Γ— 24.15). Maximum simultaneous position count: 64 levels. Commission: 0.10% taker β€” Bybit spot reference; adjust for OKX (~0.08%) or your venue. Slippage: 2 ticks β€” typical taker execution on liquid spot pairs. Margin for Long and Short Positions: 100% (1Γ— leverage assumed; no margin amplification). Indicator Settings: Default Configuration. Grid Mode: Geometric High Price: 0.15466 Low Price: 0.10591 Levels: 64 Amount per Level: 24.15 USDT Trailing Up: disabled Step (computed): 0.61% Strategy: Long Only.πŸ”· STRATEGY RESULTS ⚠️ Remember, past results do not guarantee future performance. Net Profit: +365.72 USDT (+18.29%) Max Drawdown: 540.57 USDT (26.04%) Total Closed Trades: 1,026 Percent Profitable: 55.26% (567 / 1,026) Profit Factor: 1.952 Average Trade: [to fill from Strategy Tester report] Average # Bars in Trades: [to fill from Strategy Tester report] Reference backtest run on OKX:APEUSDT on 15m base chart, Jan 12 β€” May 14, 2026. The period included a sustained drawdown phase in Feb–Mar 2026 where APE traded near the Grid Low boundary, producing the 26% max drawdown reading. The strong recovery starting late April 2026 produced most of the realized P&L through aggressive grid unwinding. This is a representative profile for a static range grid: strong recovery returns are possible but only after enduring full grid accumulation drawdowns.πŸ”· How to Use It: πŸ”Έ Adjust Settings: Set the grid High and Low boundaries based on the instrument's observed range over the past 1–3 months. Use 50–80 levels for high-volatility altcoins, 30–50 for major pairs. The amount per level should be sized so that filling the entire ladder (all 64 levels) does not exceed your risk budget. The default 24.15-USDT structure is calibrated for a 2,000-USDT account; scale linearly to your equity. Always confirm you are on a 15-minute chart. πŸ”Έ Results Review: Verify Maximum Drawdown stays within your personal risk budget. This static grid showed a 26% drawdown on the tested period, which is well above the typical 10% threshold many traders target. The trade-off is a strong absolute return of +18.29% over 4 months β€” the question is whether the recovery profile fits your psychological and capital risk tolerance. Calculate the full-grid-filled scenario before going live: if all 64 levels fill at the Low boundary and price drops another 10% below, what is the unrealized loss? That is your hard floor. πŸ”Έ Create alerts to trigger the connected bot: The strategy exposes a "grid_start" alert that fires once when the first bar enters the configured backtest window. Configure the alert in TradingView with the webhook URL pointing to your bot's signal endpoint. The Bot ID, Email Token, and Pair label can be set in the script's inputs. Note that grid bots are typically configured directly within the bot interface, so this alert is primarily informational for monitoring purposes.πŸ”· INDICATOR SETTINGS Grid High Price β€” Upper boundary of the grid range. Grid Low Price β€” Lower boundary of the grid range. Grid Levels β€” Total number of price levels between Low and High (default 64). Grid Mode β€” Distribution of levels: Geometric (constant % spacing) or Arithmetic (constant absolute spacing). Amount per Level (USDT) β€” Notional value of each buy fill. Total Investment (USDT, ref) β€” Reference total capital deployed across all levels (informational). Trailing Up β€” Disabled by default; enable to make grid shift up on breakout (turns this into the adaptive Geometric Grid Machine variant). Trail Up Threshold % β€” Percentage above High at which trailing-up triggers (only used if Trailing Up enabled). Shift Up Magnitude % β€” How much of the current range to shift when trailing-up fires (only used if Trailing Up enabled). Limit by Date Range β€” Constrain backtest to a specific date window. Show grid lines on chart β€” Toggle visual display of all level lines. Recommended TF (for warning) β€” Timeframe baseline for the runtime mismatch warning (default 15m). Stats card / Watermark β€” Display layer controls for on-chart backtest summary and branding. Webhook β€” Bot ID, Email Token, and Pair label for connected bot signal routing.πŸ‘¨πŸ»β€πŸ’»πŸ’­ 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