ADXR — ADX Rating
Today’s ADX averaged with the ADX from lookback bars ago. Wilder’s own smoothing of his
smoothing: slower to rise, slower to fall, and less prone to the false regime flips that a
single ADX crossing produces.
Signature
ADXR(period, lookback, on=<source>)| Argument | Type | Required | Notes |
|---|---|---|---|
period |
int Param or literal | Yes | ADX smoothing length. Default 14, bounds 1–100. |
lookback |
int Param or literal | Yes | How far back the second ADX reading comes from. Default 14, bounds 1–100. |
on= |
symbol | No | Source symbol. Defaults to the trade symbol. Reads high, low, close. |
Formula
$$ \text{ADXR}_t = \frac{\text{ADX}t + \text{ADX}{t-m}}{2} $$
Warmup
About 2 × period + lookback bars — the ADX must seed before the lookback can fill.
Reading the value
adxr.valueadxr.value > 25Example
class AdxrRegime(Strategy): """A slower trend gate than ADX alone.""" trade = Symbol() sizing = FixedCapital()
def execute(self): adxr = ADXR(14, 14, on=self.trade) sma = SMA(50, on=self.trade) if adxr.value > 25 and self.trade.close > sma.value and self.trade.is_flat: self.buy(self.trade, reason=f"ADXR {adxr.value:.0f}") if adxr.value < 20 and self.trade.is_long: self.sell(self.trade, self.trade.position, reason="Trend rating faded")Notes
- Wilder (1978). The ADX inside is the same construction as the
ADXindicator. - Proven by an assert-via-trade run on SPY daily (stayed inside 0–100 on every bar of a 140-bar run; zero alarm trades).
- Direction-blind like ADX — pair it with
ADX’s DI outputs for direction.