[3Commas] EURUSD Grid Bot - Long Strategy by 3Commas
By 3Commas
Performance Metrics
- Author: 3Commas
- Symbol: KRAKEN:EURUSD
- Timeframe: 15 minutes
- Win Rate: 62.7%
- Profit Factor: 2.867
Description
[3Commas] EURUSD Grid Bot - Long Strategy๐ท What it does:This is a long-only price-grid strategy that harvests volatility on EUR / USD 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 37 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.70% 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: - Range traders harvesting the tight, mean-reverting oscillations of EUR / USD on lower timeframes. - 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, low-volatility contributor. - Traders who prefer mechanical execution over discretionary entries on a major FX pair.๐ท 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 0.2% 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 37 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 quote currency and % of starting capital), so live performance is visible directly on the chart. - Calibrated for EUR/USD 15m: Default bounds, level count, and step size are set against EUR/USD's recent observed range. The 37-level geometric ladder gives roughly 0.2% per step โ tight, to match the low intraday volatility of a major FX pair, while still aiming to clear fees on each round-trip.๐ท Considerations Before Using the Strategy: Fees vs. a Tight 0.2% Step (Critical): With a step this narrow, transaction costs are the single biggest determinant of profitability. A 0.2% round-trip leaves very little room: at 0.06% per side the fee already consumes ~0.12% of each cycle, and on a higher-fee spot venue the strategy can turn unprofitable. Set the commission input to your venue's actual fee tier (use maker fees if you place limit orders) before trusting any result. Do not deploy with an unrealistic fee assumption. Market Selection & Range Validity: Grid strategies are most profitable in range-bound, mean-reverting markets โ which suits EUR/USD's typical behavior, but a sustained trend below the Low bound will leave the lower slots loaded until price returns. The default High/Low (1.1277 / 1.04884) was set against EUR/USD's recent range; update both whenever the regime changes. Capital Deployment & Drawdown: The default Investment of 20,000 equals 100% of starting capital. Per-slot risk is low (~2.70% of equity), but if price breaks below the Low bound, aggregate unrealized loss can grow. 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. Per-trade risk is structurally capped by the per-slot allocation (Investment / N) โ at defaults ~540 per slot, inside the conventional 5โ10% per-trade band. Aggregate exposure is controlled separately via the Investment input. Test Window: The reference backtest covers a relatively short window (~1.8 months). Re-run over a longer period spanning different volatility regimes to confirm the edge holds before committing capital. 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 range and is sensitive to fees.๐ท STRATEGY PROPERTIES Symbol: KRAKEN:EURUSD โ strategy is portable to any EUR / USD feed. Timeframe: 15M Test Period: April 1, 2025 โ May 25, 2025 (~1.8 months). Initial Capital: 20,000. Total Investment: 20,000 (100% of capital, high-conviction setting). Order Size per Slot: Investment / 37 โ 540 (~2.70% of equity). Commission: 0.06% per trade (set to your venue's actual fee โ critical at a 0.2% step). Slippage: 3 ticks. Margin for Long Positions: 100%. Indicator Settings: Default Configuration. Grid Bounds: High 1.1277 / Low 1.04884 (range โ6.99%). Grid Levels: 37 (Geometric spacing, ~0.2% 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: +121.76 USD (+0.61%) Max Equity Drawdown: 49.94 USD (0.25%) Total Closed Trades: 162 Percent Profitable: 62.35% (101 / 162) Profit Factor: 2.832๐ท How to Use It: ๐ธ Adjust Settings: Open the strategy inputs and set the High and Low bounds to a range you expect EUR/USD 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. Crucially, set the commission to your venue's real fee. ๐ธ Results Review: Run a full-period backtest and confirm Max Drawdown stays within your personal risk band. This configuration produced 162 closed trades over the test window (above the ~100-trade floor), but over a short ~1.8-month period โ validate over a longer span before relying on it. ๐ธ 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 37, range 7โ200). Spacing Mode: Geometric (constant percent step) or Arithmetic (constant absolute step). Total Investment: 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.