Relation to trendlines
Where the close sits in its last 100-bar closing range: -1 at the low, +1 at the high.
Despite the name, this is not a sloped trendline. It takes the lowest and highest close of the last 100 bars from the default Donchian inputs and maps the current close linearly onto that range: the low is -1, the midpoint 0, the high +1. The two edges are flat, so the value shows position inside a range, not a line the price is approaching. On the SPY one-minute sample the value stayed inside -1 to +1.
How to read it
- The line sits in its own pane below the price, between -1 and +1.
- Near +1 the close is at or near the highest close of the last 100 bars; near -1 it is at or near the lowest; near 0 it is mid-range.
- During a steady climb the value tends to stay near +1, because each close makes a new 100-bar high.
- On the one-month SPY sample the 95th percentile was +1.0, so the value reached the top edge often.
What it outputs
- Position in range
- Where the close sits in the last 100 bars' closing range: -1 at the lowest close, 0 at the midpoint, +1 at the highest. Blank for the first ~100 bars while the window fills.
Pitfalls
- The name says trendlines, but the edges are flat 100-bar closing extremes with no slope; a trend keeps the value at an edge rather than signalling a break.
- Built from closes, not wicks: a bar that spikes beyond the range but closes inside it does not move the value.
- The code divides by the channel width (highest close minus lowest) with no zero guard, so a perfectly flat 100-bar window would divide by zero. Unverified what happens at runtime in that case.