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

MA crossover entries gated by ATR filter (prefer Step 4) — ADX is not in TradingView Basic. Export Pine v6 and test with costs.

📖 4 min read

📝 741 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.



Tactix AI — Studio vs Guide

Tactix AI is AlfaTactix’s product assistant brand (open Tactix AI).

  • Tactix Studio turns a one-sentence strategy description into a draft across Timeframe, Signals, Filters, and Risk in the visual Strategy Builder. You review and edit every field before Code Generator writes MQL5 or Pine Script.
  • Tactix Guide explains the step you are on — what to fill, what a control means, or how to phrase a rule — without dumping untested source code.

That is form-first automation: the LLM never replaces Code Generator, and you keep plan limits and real-time validation.

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 you keep indicator headroom. DemoEditorTester.

No. ADX is not in TradingView Basic. ATR gates range size / expansion, not directional strength. MT5 cousin role only: ADX filter EA.

Preferred: Step 4 atr filter (does not consume an indicator slot). Alternative: ATR as Step 3 indicator + one MA — still ≤2. See ATR filter · MA playbook.

EMA/SMA Golden/Death or Period 10 family; ATR length 14; require ATR above a threshold or expansion before entries; H1; ATR stops in Step 5 — risk.

UNSUPPORTED. Use SMA/EMA/WMA vs price or another MA.

No ADX / SuperTrend / Ichimoku / news / MTF. Hub.