Skip to main content

XGrid Strategy

What It Does

XGrid is a high-frequency momentum grid scalper: it detects short-term trend direction with technical signals, places a tight grid of orders in that direction, and takes profits within seconds-to-minutes rather than hours.
Naming, to avoid confusion: in the Marketplace tab, the “XGrid” family label covers the high-frequency Perp Market Maker presets (MM Professional, v7/v8 Counterscalp, HFT v6, …) — the two-sided grid scalper documented in the Perp Market Maker guide. This page covers the XGrid trend signal engine that powers those presets’ counter-scalp features, plus the standalone XGrid strategy. If you came here from a Marketplace card, start with the Perp MM guide and come back here for the signal details.

The XGrid Trend Signal

The signal engine answers one question every 30 seconds: is short-term momentum long, short, or unclear? It returns LONG, SHORT, or neutral, and is consumed by the Perp MM’s counter-scalp and entry logic.

How a signal is built

1-minute candles


EMA 11 vs EMA 23  ──────────►  EMA11 > EMA23 → bullish bias
                               EMA11 < EMA23 → bearish bias
      │                        roughly equal → no signal

Donchian breakout check ────►  price near the 15-candle high/low
                               (within 0.30% tolerance) confirms direction


NATR volatility filter ─────►  volatility must exceed its own recent
                               baseline (1.1x the 60-candle NATR) and an
                               absolute floor — no signals in dead markets


Peak/trough confirmation ───►  recent swing structure must agree


SIGNAL: LONG / SHORT  (cached for 30 seconds)

Signal parameters (actual engine defaults)

timeframe
string
default:"1m"
Candle timeframe the signal runs on. The engine is designed for 1-minute momentum.
donch_len
integer
default:"15"
Donchian channel lookback (candles) for the breakout confirmation.
breakout_tol_pct
float
default:"0.30"
How close to the channel boundary (in %) price must be to count as a breakout.
natr_len
integer
default:"60"
Lookback for the Normalized ATR volatility baseline.
natr_mult
float
default:"1.1"
Current volatility must exceed natr_mult × its baseline for a signal to fire.
min_natr_abs
float
default:"0.02"
Absolute NATR floor (%). Below this the market is too quiet to scalp regardless of relative volatility.
cache_seconds
float
default:"30"
Signals are cached for 30 seconds to limit API load; the engine re-evaluates when the cache expires.
The EMA pair (11/23) is fixed in the engine — the fast EMA reacts to the last ~10 minutes, the slow one filters noise, and their cross defines the bias.

Standalone XGrid Strategy

The standalone XGrid strategy (selectable as strategy: "xgrid") is a faster, tighter sibling of Vortex DCA:
  • 2-second take-profit refresh (vs 60s for Vortex) — exits are managed near-continuously
  • 2-minute default grid refresh (vs 3 minutes for Vortex)
  • Exponential level spacing: levels start at a configurable first_level_distance from price and spread out with a power curve toward outer_distance, packing more orders close to the action
  • Startup cleanup: cancels existing orders on boot so stale orders from a previous run can’t interfere
  • Shares Vortex’s virtual-chunking position recovery (3% threshold, 5 chunks, 0.1% per-chunk target by default)
It uses the same core parameters as Vortex (nr_clusters, outer_distance, wallet_exposure, minimum_tp) with tighter values. Current Marketplace presets deploy the perp_mm implementation instead, which layers full two-sided quoting and risk tiers on top of the same high-frequency idea.

How the Signal Drives Perp MM

XGrid Counter Scalp

When the Perp MM’s main position is underwater and the XGrid signal points the other way, the bot opens a counter-position to scalp the move against you:
Main position: LONG, underwater
XGrid signal:  SHORT (downtrend confirmed)


Open SHORT counter-position (capped at max_counter_pct of main, default 50%)
Quick take-profit on the counter
→ losses on the main position are partially offset while it waits to recover
Key behavioral guards:
xgrid_counter_scalp.enabled
boolean
default:"false"
Enable counter-trend scalping. On in the v7/v8 Counterscalp and HFT v6 presets.
xgrid_counter_scalp.max_counter_pct
integer
default:"50"
Counter position cap as % of the main position.
xgrid_counter_scalp.require_signal_cycle
boolean
default:"true"
The signal must cycle through neutral before re-entry (prevents whipsaw churn on a noisy signal).
xgrid_counter_scalp.min_main_age_seconds
integer
default:"300"
The main position must be at least this old before counter-scalping starts.

Godmode Scalp

A stricter variant that only fires when multiple confirmations align: main position underwater past a threshold, XGrid confirming the opposite trend, and a whale wall present on the counter side. Fewer entries, higher conviction.

When the Signal Works Well (and When It Doesn’t)

MarketSignal quality
Quiet, low volatilityNo signals by design — the NATR filter blocks them
Steady directional movesGood — EMA cross + Donchian breakout align
High volatility with follow-throughGood — strong, early signals
Violent chop / whipsawWeakest case — crosses flip; the signal-cycle guard and peak confirmation reduce but don’t eliminate false entries
Prefer liquid symbols (majors, high-volume alts). On illiquid pairs, the 1-minute candles are too noisy for the breakout logic.
Counter-scalping trades against your own underwater position. It can offset losses in a continued trend, but if the market V-reverses, the counter position loses while the main recovers. The caps above (max_counter_pct, signal-cycle requirement) bound that risk — they don’t remove it.

Troubleshooting

”No signals generated”

  1. Volatility below min_natr_abs or below natr_mult × baseline — the market is too quiet, which is intended behavior
  2. EMA11 ≈ EMA23 (no clear bias) — check the log’s rejection reason
  3. Signal cached — changes only propagate after the 30s cache expires

”Too many false signals”

Whipsaw conditions. The signal-cycle requirement (require_signal_cycle) is the main defense; verify it’s enabled before tuning anything else.

Next Steps

Perp Market Maker

The strategy these signals power (Marketplace “XGrid” family)

Preset Guide

Which counterscalp preset to pick