Channel
Marks stretches where the 100-bar high and low lines slope together, a parallel or flat channel.
The channel takes the highest and lowest close over the last 100 bars, and how far each has moved over the last 20 bars, in percent. It is on when both lines slope the same way (up, down or both flat), their slopes differ by no more than channel_eps percentage points, and the high is above the low. A flat pair passes too, so sideways ranges mark as readily as sloped channels.
How to read it
- Each marker is a bar where the channel holds. A run of consecutive markers is one stretch; its first marker is where it starts.
- It carries no direction. Up, down and flat channels all mark, so read the price slope yourself to tell them apart.
- With defaults on SPY one-minute bars it was on for about 40% of bars and started about 22 times a day, so markers cover much of the chart.
What it outputs
- Channel
- A marker on each bar where both lines slope the same way and their slopes differ by at most channel_eps.
When it fires
The first marker of a run is the bar where both lines begin to slope the same way within channel_eps of each other, the start of a parallel or flat channel. It is a state, not a breakout. With defaults a run lasts about 18 minutes on average before the lines stop matching.
Settings
- channel_eps
- The largest gap allowed, in percentage points over 20 bars, between the high and low slopes. Raising it lets less parallel channels mark. Near 0 it keeps only matching slopes, and flat stretches still mark. Below 0 it never marks.
Pitfalls
- Markers cover about 40% of bars with defaults, so the chart gets busy. Read the first marker of each run, not every marker.
- The lines use closing prices, not highs and lows, so intrabar wicks are ignored and only closes move the lines.
- The sign test is strict: a high line at +0.01 and a low line at -0.01 fails, though both are nearly flat and parallel, so near-flat ranges can drop out.