TWT Grid Strategy [3Commas] by 3Commas
By 3Commas
Performance Metrics
- Author: 3Commas
- Symbol: BYBIT:TWTUSDT.P
- Timeframe: 15 minutes
- Win Rate: 55.1%
- Profit Factor: 0.971
Description
TWT Grid Long Strategy [3Commas]🔷 What it does:This is a long-only price-grid strategy that harvests volatility on TWT / USDT 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 the price scale. - Up to 62 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 1.6% of equity at default settings, comfortably inside the conventional 5–10% per-trade risk band. - 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 TWT 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-trade risk. - 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 (default), level k is at High × (Low/High)^(k/(N-1)), giving constant percent spacing — approximately 1.02% per step at default settings. In Arithmetic mode, levels are linearly spaced by absolute price. 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 (Investment / N). When bar close moves price up through the level immediately above an owned slot, that slot is closed, locking the round-trip profit between the two adjacent levels. 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 — slots whose entry price is below current market simply wait until price comes back. This is the canonical grid-bot behavior. Capital Bounds: Total deployed capital cannot exceed the configured Investment. When all 62 slots are filled, no new orders are opened until price rises and starts closing slots. This structural cap is the strategy's primary risk control.🔷 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 ("Grid_BUY_L5" / "Grid_TP_L5"). The strategy can drive a DCA Bot configured for grid emulation without any glue layer. - Pre-Allocated State: All up to 200 slot ledgers live in fixed-size arrays, so state lookups are constant-time and the chart can render every active slot with no performance overhead. - Honest Backtest Surface: The avg entry line plotted on the chart and the open PnL displayed in the status table both reflect the actual broker-equivalent position state — derived from fill-by-fill bookkeeping, not synthetic averaging. The status table also reports the cumulative realized net profit (how much the grid has actually earned, in USDT and % of starting capital), so live performance is visible directly on the chart. - Calibrated for TWT 15m: Default bounds, level count, and step size are set against TWT's recent observed range. The 62-level geometric ladder gives roughly 1.02% per step — wide enough to clear taker fees on each round-trip, granular enough to keep catching 15m swings inside the range.🔷 Considerations Before Using the Strategy: Why the Net Profit Looks Small: At the end of the reference backtest the net closed profit is thin (+192.35 USDT / +0.96%) — but this is not the whole picture. Because TWT drifted down toward the lower half of the range and sat there, almost all grid levels are currently loaded: a large share of the capital is tied up in open long slots that have been bought on the way down and are still waiting for price to rise back through their exit level. Those slots are holding unrealized value that has not yet been converted into realized profit. In a grid strategy the realized profit only accrues as slots complete their round-trip; when the grid is nearly fully loaded near the lows, most of the equity is sitting in open positions rather than banked profit. If price recovers into the upper half of the range, those loaded slots close in sequence and the realized profit rises accordingly. Market Selection & Range Validity: Grid strategies are most profitable in range-bound, mean-reverting markets. On strong directional trends below the configured Low, slots will keep loading as price falls and won't close until price reverses. The default High/Low (0.5795 / 0.3134) was set against TWT's recent observed range; update both whenever the regime changes. Capital Deployment & Drawdown: The default Investment of 20,000 USDT equals 100% of starting capital — high-conviction setting that assumes the configured range holds. Per-slot risk is moderate (~1.6% of equity), but if price collapses below the Low bound, aggregate unrealized loss can grow further — the reference backtest reached a 20.03% maximum equity drawdown, driven by the same fully-loaded-grid dynamic described above. Scale the Investment input down to match the worst-case drawdown you are willing to absorb. No Stop Loss Justification: There is no exit on adverse moves below the lowest grid level. The strategy's per-trade risk is structurally capped by the per-slot allocation (Investment / N levels) — at defaults that is ~323 USDT per slot, inside the conventional 5–10% per-trade band. The aggregate unrealized exposure is controlled separately via the Investment input. Trade Volume & Fees: Grid bots on 15m generate a high number of round-trips — the reference backtest logged 1,227 closed trades, far above the ~100-trade floor for statistical relevance. The ~1.02% step is deliberately wider than a tight scalp grid so each round-trip aims to clear the taker fee, but with a profit factor of 0.971 the realized edge is currently below break-even on closed trades alone; the strategy's positive total return in this window comes from the open-slot value, so match the commission (0.1% per trade) to your exchange's actual fees carefully. Demo Testing: Always demo-test before going live. Past results do not guarantee future performance, especially on a strategy whose profitability is bounded by the chosen High/Low range remaining valid.🔷 STRATEGY PROPERTIES Symbol: BYBIT:TWTUSDT.P (Perpetual) — strategy is portable to any TWT / USDT pair. Timeframe: 15M Test Period: May 1, 2025 — July 1, 2026 (~14 months). Initial Capital: 20,000 USDT. Total Investment: 20,000 USDT (100% of capital, high-conviction setting). Order Size per Slot: Investment / 62 ≈ 323 USDT (~1.6% of equity). Commission: 0.1% per trade. Slippage: 3 ticks. Margin for Long Positions: 100%. Indicator Settings: Default Configuration. Grid Bounds: High 0.5795 / Low 0.3134 (range −45.92%). Grid Levels: 62 (Geometric spacing, ~1.02% per step). Stop Loss: None — per-slot allocation is the structural risk cap. Trailing: None. Strategy: Long Only.🔷 STRATEGY RESULTS ⚠️ Remember, past results do not guarantee future performance. Net Profit: +192.35 USDT (+0.96%) Max Equity Drawdown: 4,636.76 USDT (20.03%) Total Closed Trades: 1,227 Percent Profitable: 55.09% (676 / 1,227) Profit Factor: 0.971 Note: at the end of this window nearly all grid levels are loaded with open long slots, so a large share of the position value is unrealized and not yet reflected in the closed-trade profit factor.🔷 How to Use It: 🔸 Adjust Settings: Open the strategy inputs and set the High and Low bounds to a range you expect TWT to respect. Pick Geometric for percent-spaced levels (default, recommended) or Arithmetic. Set Grid Levels (7–200) and Total Investment to match your risk profile. 🔸 Results Review: Run a full-period backtest and confirm Max Drawdown stays within your personal risk band — note this configuration reached 20.03% while the grid was heavily loaded. The 1,227 closed trades are far above the ~100-trade floor for statistical relevance, but the 0.971 profit factor shows the realized edge is currently below break-even; the strategy's value in this window is concentrated in open, not-yet-closed slots. 🔸 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. Every grid-level buy and grid-level close will emit a dedicated JSON payload tagged with the slot index, so each level can be tracked independently downstream.🔷 INDICATOR SETTINGS High Price: Top of the grid. The highest level a slot can be created from. Low Price: Bottom of the grid. The lowest level a slot can be created from. Grid Levels: Number of price levels between High and Low (default 62, range 7–200). Spacing Mode: Geometric (constant percent step) or Arithmetic (constant absolute step). Total Investment (USDT): Total capital allocated across all slots. Per-slot size = Investment / Grid Levels. 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 (shows range, levels, owned slots, investment, per-slot size, open PnL, and cumulative realized net profit). Brand Watermark: Configurable text, position, size, and transparency.👨🏻💻💭 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.