Trend strength
How one-sided the recent bars were, from 0 (balanced) to 100 (all moves one way), with no up or down sign.
TrendStrength computes the directional index (DX), the core step of ADX, over the last N bars. It averages the true range and the up-moves and down-moves of the highs and lows, then reports how far the up-side and down-side pressure differ, scaled 0 to 100. It measures how one-sided recent bars were, not which way price moved: a steep rally and a steep sell-off both read high.
How to read it
- The line sits in its own pane below the price, between 0 and 100.
- Above 25 the recent bars leaned one way more than the other; above 50 is a strong one-sided run. Check the candles for which way it runs.
- Read it as intensity only: a high reading in a sell-off looks the same as one in a rally.
- A climb out of the low values means balance is giving way to a run; a fall back means the run is fading.
What it outputs
- Trend strength
- Directional index from 0 to 100: how far up-side and down-side pressure differ over the window, with no sign for direction.
Settings
- window
- How many recent bars the averages cover. Short windows (under about 10) reach high readings from ordinary noise, so the line jumps; long windows average noise out, so the line sits lower and only a sustained one-way run lifts it.
Pitfalls
- It has no direction: in the SPY sample its correlation with the close is about zero, so it cannot tell a rally from a sell-off.
- It is the raw DX, not the smoothed ADX most charting tools show, so it jumps bar to bar; the first 14 bars at the default window have no value.
- The docstring's 25 and 50 cut-offs are not rare events: with default settings the line is above 25 more than half the time (median 30), so 25 marks normal conditions, not a strong trend.