Skip to content

Trend strength and direction

Strength and direction answer different questions. ADX measures strength; +DI and −DI describe directional movement. Aroon describes how recently the window's price extremes occurred. These functions return series and automatically use the complete bars.

ADX and directional indicators

Function Call Reading
adx adx(14) ADX line, normally 0–100. A higher value means stronger directional movement, without choosing up or down.
plus_di plus_di(14) Positive directional movement relative to true range, ×100.
minus_di minus_di(14) Negative directional movement relative to true range, ×100.

All three accept a single period, default 14. Use adx() for its default or adx(bars, 14) for an explicit input. The equivalent forms apply to +DI and −DI.

adx(14) > 25
plus_di(14) > minus_di(14)
adx(14) > 25 and plus_di(14) > minus_di(14)
plus_di(14) crosses over minus_di(14)

The first condition describes strength in either direction. The combined condition requires strength and positive directional movement above negative movement. The crossing is true only on the transition bar. A threshold of 25 here is a rule choice, not a required value or a percentage position size.

ADX uses high, low and previous close and then smooths its directional calculation. Allow more history than a single raw price comparison. Use matching periods on ADX and the DI lines when they describe the same system.

Aroon

Aroon measures the position of the most recent high and low within a window. The default period is 25.

Function Call Reading
aroon_up aroon_up(25) Up line, 0–100; a more recent window high gives a higher reading.
aroon_down aroon_down(25) Down line, 0–100; a more recent window low gives a higher reading.
aroon aroon(25) Up minus Down, −100 to 100. The bare name selects the oscillator.
aroon_up(25) > aroon_down(25)
aroon(25) > 0
aroon_up(25) > 70 and aroon_down(25) < 30

The first two tests describe the same ordering at matching settings. The third adds two explicit thresholds. Use aroon() or aroon_up() for default settings; aroon(bars, 25) is the explicit form. Aroon needs high and low, and its window includes the current bar. It measures recency of an extreme, not the percentage price move since that extreme.

For averages that describe price direction, see moving averages. For range width and price movement, see volatility.