Horizontal channel
Marks bars where the 100-bar closing high and low have both stayed level, a sideways range.
The indicator takes the highest and lowest close of the last 100 bars, the two edges of a range, and measures how far each edge moved over the last 20 bars, in percent. It is true on a bar when both edges moved no more than slope_eps (0.05 percent by default, about 0.4 dollars on SPY near 765), in the same direction, with slopes that differ by no more than channel_eps. It draws no line, only markers on the bars where that holds.
How to read it
- Markers sit on the candles where the condition holds; the indicator draws no line of its own.
- A run of markers means both edges of the 100-bar closing range stayed level for that stretch.
- The marker describes sideways price between a level floor and ceiling; it does not say which way price will break out.
What it outputs
- Flat channel
- Fires on bars where the 100-bar closing high and low both moved less than the slope limit over 20 bars and moved together.
When it fires
Fires on each bar where both closing-range edges moved no more than slope_eps over the last 20 bars, in the same direction. It means the range has stopped moving: price is holding between a level floor and ceiling.
Settings
- Slope Epsilon
- Largest percent move each edge may make in 20 bars and still count as level; 0.05 is about 0.4 dollars on SPY near 765. Raising it admits tilted ranges and more markers; lowering it keeps only dead-level edges and fewer markers.
- Width Epsilon
- Largest allowed gap between the two edges' 20-bar percent slopes (the catalog wrongly calls it a price width). Lowering it forces the edges to move in step. It only bites when slope_eps is above half this value, so at defaults it changes nothing.
Pitfalls
- Common at default settings: about 29% of bars in the September SPY sample, roughly 22 events a day, so markers are dense rather than rare.
- The catalog calls channel_eps a price width, but the code caps the gap between the two edges' percent slopes. At defaults it never rejects a bar, so changing it does nothing until slope_eps rises.
- Both edges must tilt the same way: a floor rising 0.01% while the ceiling falls 0.01% is rejected, even though both are essentially level.