Volatility Gate¶
Data · Filters
Emit True when the bar's true range is normal (entry allowed), False on a range spike — the OHLCV proxy for the wide-spread / news conditions to avoid. AND with your entry signal to skip them.
Volatility Gate is a safety filter that keeps you out of abnormal bars. It watches each bar's true range and emits true ("OK") when the range is normal and false when the range spikes — the bar-data proxy for the wide-spread, fast-moving, news-driven conditions where fills are bad, spreads blow out, and stops get run. You wire it into your entry logic so the strategy simply sits out those moments instead of getting picked off by them.
How it works¶
Over the Avg range window (default 14) the block tracks the rolling average true range — the instrument's "normal" bar size lately. Each bar it compares the current true range against that average: if the range exceeds Max range × avg (default 2.0× the rolling average), the bar is flagged as a spike and the OK signal goes false; otherwise it stays true. So a bar more than twice its recent typical range — the kind of candle a news release or liquidity gap prints — turns the gate off. The threshold multiplier is your sensitivity dial: lower (1.5) is stricter and blocks more, higher (3.0) only vetoes the most violent bars.
It's an approximation of spread/news risk built purely from OHLC — it has no spread feed or economic calendar — but range-spikes correlate strongly with exactly the conditions you want to avoid, so it's a robust, data-only guard.
When to use it¶
Use Volatility Gate to protect entries from abnormal conditions. The pattern is simple: And the OK signal with your entry trigger so trades only fire on normal-range bars. It's especially valuable for mean-reversion and breakout systems that would otherwise enter straight into a news spike, and for any strategy on instruments prone to sudden gaps. It's a defensive filter, not a signal — it never tells you to trade, only when not to.
Example¶
Skip the spikes: wire your Data Source bars into Volatility Gate, then And its OK output with your Crosses Above entry into a Buy Signal — so an otherwise-valid signal on a violent news bar is simply ignored. Backtest with and without the gate in the Tester to see how many bad-fill entries it removes.
Tips & gotchas¶
- It's a defensive AND-filter. Combine the OK signal with your entry; it never generates trades itself.
- The multiplier is your strictness dial — 1.5 blocks aggressively, 3.0 only vetoes extreme bars. Tune per instrument.
- A proxy, not a spread/news feed — it infers risk from range spikes, which correlate with (but don't literally measure) wide spreads and news.
- Pairs naturally with session/time filters — combine with a Session Filter to dodge both volatile bars and known news windows.
Related blocks¶
Inputs¶
| Socket | Type | What to wire in |
|---|---|---|
| Bars | bars |
Source bars (uses high/low/close for true range). |
Outputs¶
| Output | Type | Plots as | Description |
|---|---|---|---|
| OK | signal |
Signal arrows | True when the bar's range is at or below the threshold. |
Parameters¶
| Parameter | Type | Default | What it does |
|---|---|---|---|
| Avg range window | number · 2–200 | 14 |
Bars used for the rolling average true range. |
| Max range × avg | number · 1.0–10.0 | 2.0 |
Block bars whose true range exceeds this multiple of its rolling average — the volatility-spike / news proxy. |
Reference auto-generated from the block catalog · category Data.