ATR Regime + MA Pine Strategy (Volatility Gate — Not ADX)

MA crossover entries gated by ATR filter (prefer Step 4) — not an ADX trend filter. Export Pine v6 and test with costs.

📖 4 min read

📝 704 words

🏷️ Pine Script and TradingView

Share this article:

A fixed ATR threshold is not portable

ATR measures the average size of recent bars, and it reports that size in the instrument's own price units. That one property decides how you should build with it.

An ATR of 1.5 means:

On1.5 ATR is
EURUSD quoted to 5 decimalsan enormous move
a stock priced at 40a normal daily range
an index at 18,000almost nothing

So a filter written as "only trade when ATR is above 1.5" is not a volatility filter. It is a filter that happens to select almost every bar on one instrument and almost none on another, and it cannot be moved between symbols at all.

The fix: divide ATR by something with the same units

A ratio of two quantities in the same units is dimensionless, which makes it mean the same thing everywhere. Two constructions, both available in a form:

ATR against its own average — "ATR above its 50-period average" says volatility is expanding relative to its own recent normal. That is a genuine regime statement, and it is identical in meaning on EURUSD and on an index.

ATR as a fraction of price — ATR divided by close gives you a percentage range. Useful when you want an absolute notion of "quiet" rather than a relative one.

Both are portable. A fixed ATR level is not. This is the same reasoning that makes a CCI threshold unportable while an RSI threshold largely is — why CCI has no ceiling.

Why this matters beyond tidiness

Testing on a second instrument is the single best check that you built a strategy rather than a description of one market — it is on the evidence list in what to hold before risking money.

You cannot run that test at all if your filter is calibrated in the price units of the first instrument. So making the filter dimensionless is not a style preference; it is what makes the most important test possible.

Building the regime filter with a trend entry

FieldValueRole
MA fast / slow20 / 50the entry signal
ATR length14
Regime conditionATR above its own 50-period averageonly trade when volatility is expanding
Stop2 × ATRscales with the instrument automatically
Target3 × ATR

The ATR-based stop is the other reason ATR belongs in almost every strategy: a stop in ticks has to be re-tuned per symbol, and a stop in ATR does not. The trade-off is real though — an ATR stop widens exactly when the market turns violent, which is when you may most want to be out. It is a choice, not a free improvement.

And the honest caveat

A volatility filter tells you the size of recent moves. It says nothing about direction, and nothing about whether the expansion will continue. Combining it with a trend entry is sensible; expecting it to predict anything on its own is not. Confirm it earns its place by counting how many trades it removes — the count test.

Frequently Asked Questions

Yes. Use MA crossover (or price vs MA) for entries and ATR as a volatility gate — prefer ATR in Step 4, so entries and the volatility gate stay separate. Demo → Editor → Tester.

No. ADX is a different indicator and one of the 47 indicator types. ATR gates range size / expansion, not directional strength. ADX playbook on MetaTrader 5: ADX filter EA.

Preferred: the ATR gate in Step 4. Alternative: ATR as a Step 3 indicator plus one MA. See ATR filter · MA playbook.

Two moving averages (fast “crosses above” slow); ATR length 14; require ATR above a threshold or expansion before entries (quick filter “Skip quiet markets”: ATR(14) above its 50-bar average); H1; ATR stops in Step 5 — risk.

VWAP is an indicator of its own (Step 3, Indicator tab). Compare price with it, or use SMA/EMA/WMA against price or another average.

Up to 3 timeframes, 47 indicator types and up to 8 filters of 7 types. News and fundamental filters are not available yet. Hub.