OPEN-SOURCE SCRIPT
تم تحديثه

Adaptive Rolling Z-Score Channel

2 366
ABOUT

Most channel indicators draw their upper and lower lines a static distance from a moving average and leave them there. Bollinger Bands are the familiar example: the bands sit a fixed number of standard deviations from the average, and that number stays the same whether the market is crawling or running.

The Rolling Z-Score Channel decides that distance from the market's own recent behavior instead. It tracks how far price has actually been straying from its average over recent history, then places the bands where the more extreme of those moves have been landing. When conditions get choppier, the bands widen on their own. When things settle, they draw back in.

The practical effect is a channel where reaching the outer band means roughly the same thing across different market conditions and different instruments: price has stretched unusually far compared to how it has been moving lately. It plots directly on the price chart, so the levels can be read against candles, structure, and your other tools without switching panes.

HOW IT WORKS

The indicator measures how far price sits from its rolling mean, expressed in standard deviations — a z-score.

In Adaptive mode, the band levels come from the recent distribution of that z-score making it adjust to changes in market conditions more quickly. The indicator looks at where price has actually been reaching over multiple shorter lookbacks and places the upper and lower bands of those ranges. The two sides of the rolling mean are calculated independently, so the channel can be asymmetric when price has been extending further in one direction than the other. A minimum width floor prevents the bands from collapsing onto the mean during quiet periods.

Fixed Z-Score mode is also available if you prefer conventional static bands at a multiplier you set yourself.

The z-score and the band levels can each be smoothed, with a choice of filters. Smoothing reduces bar-to-bar jitter in the levels at the cost of some responsiveness.

READING THE INDICATOR

Basis line — the rolling mean, and the reference point the channel is built around. Optional gradient coloring shifts with the current deviation.
Outer bands — the adaptive extremes. Price reaching a band means deviation is large relative to its own recent range.
Inner bands — an intermediate reference, plotted at a user-set fraction of the outer distance.
Fills and glow — the shaded zones separate the upper and lower halves of the channel. When price closes outside a band, the area between price and that band fills to mark the excursion.
Re-entry markers — triangles printed when price closes back inside the channel after having closed outside it.

Alerts are included for band breaks, re-entries, and basis crosses.


SUGGESTED USE

The channel is a context tool. It describes where price sits within its recent statistical range, which is useful for entries, gauging extended and possible reversal ranges, and setting reference levels.

A few things worth understanding before using it:

The channel widens quickly when a range breaks out into a trend, since both the deviation measure and the percentile levels expand at the same time. This is intended behavior for a distribution-following band, but it means the tool is least informative during the transition from range to trend.

Defaults are set for intraday futures charts. The rolling window and percentile settings are the main levers if you are adapting it to a different instrument or timeframe. Thoroughly test out various settings for your specific chart.
ملاحظات الأخبار
Slight change.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.