Trend regime scorer
Scores 0 to 10 how far the 100-bar channel is rising, with extra points when price sits near its low.
The scorer builds a channel from the highest and lowest closes of the last 100 bars, then measures how far each edge moved over the last 20 bars. It adds up to 4 points for a rising lower edge, 3 more when both edges rise, up to 2 when price sits in the bottom half of the channel, and 1 when both edges move the same way. The total is capped at 10, and the first bars of the series stay blank while the channel fills.
How to read it
- The line sits in its own pane below the price and moves in whole steps from 0 to 10.
- 8 or higher shows on roughly 5% of bars at default settings, so a high reading is an unusual state, not a normal one.
- Around 2, the median, is the usual reading. 0 means the lower edge is not rising, price is in the upper half of the channel, and the two edges are not moving together.
- Gaps at the start of the series are warm-up while the 100-bar channel fills, not zero readings.
What it outputs
- Trend score
- Whole-number trend score from 0 to 10. Higher means the channel's lower edge is rising, both edges rise together, and price sits low in the channel.
Pitfalls
- This looks like a units mismatch. The 0.001 to 0.005 slope thresholds are tested against percent changes over 20 bars, so the top tiers fire on any small rise.
- A downtrend tops out at 3 points: a falling lower edge earns no slope points, leaving at most the same-direction point and the near-low points.
- The docstring promises trend alignment across timeframes, but the code uses one 100-bar channel of closes and no other timeframe.