Indicators/probuilder · probacktest · proorder · proscreener

ADXR

ADXR in ProBuilder returns the Average Directional Index Rating, the mean of the current ADX and the ADX value N bars ago. Syntax, formula, and examples.

Syntax

probuilder
// N as number of periods for the calculation
ADXR[N]

Parameters

NameTypeDefaultDescription
Ninteger14Period in bars, used both for the underlying ADX calculation and as the lookback for the older ADX value. No price argument; the calculation reads high, low and close internally.

Formula

code
ADXR = (ADX + ADX[N]) / 2

Averaging the current ADX with its own value N bars earlier filters out short-lived spikes in the ADX line. Since ADX is bounded between 0 and 100, ADXR is too.

How it works

ADX already smooths directional movement twice, yet it can still whip up and down when volatility clusters. ADXR addresses this by blending the present reading with a historical one. A single sharp bar can lift ADX noticeably, but it moves ADXR only half as far, and only until the spike ages out of the lookback.

The cost of that stability is lag. ADXR reacts to new trends later than ADX, and it also releases later once a trend dies. In practice the two lines are often plotted together: ADX for timing, ADXR for regime classification.

Like every member of the directional movement family, ADXR is direction-blind. It rises during persistent downtrends exactly as it does during persistent uptrends. Direction has to be established separately, typically with DIplus and DIminus.

Examples

Example 1, ADXR with a smoothed companion line (Indicator)

probuilder
// 14-period ADXR plus a slower moving-average signal line
period = 14
myIndicator = ADXR[period]
mySignal = Average[period/2](myIndicator)
RETURN myIndicator coloured(225,27,195) AS "ADXR", mySignal AS "laggy ADXR"

Adapted from the source page. The second line applies a 7-period simple moving average to the ADXR, giving a slower reference that can be watched for crossings. Note the period belongs in square brackets before the argument; Average(myIndicator)[period/2] would instead offset a default-period average back in time.

Example 2, Trend-regime filter for a breakout entry (ProOrder)

probuilder
// Buy 20-bar breakouts only while the trend regime is strong
DEFPARAM CumulateOrders = false
regime = ADXR[14]

IF NOT LongOnMarket AND regime > 25 AND close CROSSES OVER Highest[20](high[1]) THEN
  BUY 1 CONTRACT AT MARKET
ENDIF
IF LongOnMarket AND close CROSSES UNDER Average[50](close) THEN
  SELL AT MARKET
ENDIF

ADXR gates the entry so breakouts are only taken when trend strength has been sustained, not merely spiked. The exit uses a moving-average cross.

probuilder
// Instruments with a strong regime where ADX leads ADXR upward
rating = ADXR[14]
c1 = rating > 25
c2 = ADX[14] > rating
SCREENER[c1 AND c2](rating AS "ADXR 14")

When the faster ADX sits above the slower ADXR, trend strength is still building. The screener returns instruments where a strong regime is accelerating.

Interpretation

ZoneRangeReading
Weak or absent trendADXR < 20Little sustained directional movement. Trend-following signals are unreliable.
Transition20 to 25Trend strength is building or fading.
Strong trendADXR > 25A persistent trend, in either direction, is in place.

A rising ADXR indicates increasing trend strength; a falling ADXR indicates a weakening trend. Because of the built-in lookback, ADXR responds to regime changes more slowly than ADX, which makes it better suited to answering "is this market trending" than "did the trend just start".

Common errors and gotchas

  • No price argument. ADXR[14](close) raises a syntax error. The correct call is ADXR[14]; the price inputs are implicit.
  • Extra lag on top of ADX. ADXR averages a current and an older reading, so it can stay above 25 for many bars after a trend has ended. Using it as an exit trigger keeps positions open too long; prefer it as an entry filter.
  • Strength is not direction. High ADXR readings occur in downtrends as often as in uptrends. Combine with DIplus and DIminus or a moving-average test before taking sides.
  • Misplaced period bracket. Average(x)[7] indexes a default-period average 7 bars back rather than computing a 7-period average. Write Average[7](x) when smoothing ADXR or any other series.
  • ADX, the underlying Average Directional Index.
  • DIplus, the positive directional indicator (+DI).
  • DIminus, the negative directional indicator (-DI).
  • DI, the directional movement spread.
  • WilderAverage, the smoothing used across the directional movement family.
  • AverageTrueRange, the volatility normaliser inside the DI calculation.
  • TR, single-bar true range.
  • Supertrend, a directional overlay often filtered by ADX or ADXR strength.