OPEN-SOURCE SCRIPT

Keltner Channel ATR Stretch

341
Keltner Channel ATR Stretch is a Keltner Channel variant designed to show trend bias, price stretch, and volatility width in one compact view.

The script uses an EMA basis with ATR-scaled upper and lower bands. In addition to the channel itself, it normalizes the selected Source's distance from the EMA basis as Stretch, normalizes the EMA basis slope in ATR units as Bias, and ranks the current channel width against its recent min-max range as Width Rank.

The goal is not to create trade signals. The goal is to make the current chart state easier to read: whether price is inside the channel, moving with a trend bias, pulling back toward the basis, stretching beyond the outer band, reaching an extreme band, or returning inside the channel after an outside move.

Dashboard reading:
Bias shows the EMA basis direction normalized by ATR:
Bullish, Bearish, or Neutral.

Position shows where the selected Source is relative to the channel:
Trend Zone, Pullback, Upper Stretch, Lower Stretch, Extreme, or Inside.

Volatility shows the current channel width regime:
Quiet, Normal, or Expanded.

Stretch shows the distance from the EMA basis in outer-channel units.
A value near +1 means price is near the upper outer band.
A value near -1 means price is near the lower outer band.

Slope shows the EMA basis slope in ATR units.

Width Rank shows the current channel width relative to its recent min-max range.
It is a simple 0-100 rank of the current width inside its own recent range, not a statistical percentile.

How it works:
The basis is an EMA of the selected Source.
The outer bands are calculated as:
Basis plus or minus ATR multiplied by the ATR Multiplier.

The inner bands are a fractional zone inside the outer channel.
The optional extreme bands are a wider reference zone outside the outer channel.

Stretch is calculated as:
Source minus Basis, divided by the outer channel half-width.

Slope is calculated as:
Current EMA basis minus the basis from the selected lookback, divided by ATR.

Width Rank compares the current channel width to the lowest and highest channel width over the selected Width Rank Lookback.

Markers and alerts:
Upper stretch and lower stretch mark movement beyond the outer bands.
Upper extreme and lower extreme mark movement beyond the optional extreme band level.
Upper return inside and lower return inside mark when the selected Source moves back inside the outer channel after being outside it.
Trend bias changed marks a change in the ATR-normalized EMA basis direction.
Width regime changed marks a change between Quiet, Normal, and Expanded width states.

The Confirmed bars only setting is enabled by default. When it is enabled, markers and alerts evaluate only on closed bars. The dashboard reflects the current chart state, including the still-forming bar.

This is not a trading system. It is a visual analysis tool for reading channel position, trend bias, and volatility context. It does not provide trade instructions, entries, exits, or performance claims.

Limitations:
Keltner Channels are volatility-based bands and can expand or contract as ATR changes.
A stretch beyond a band does not necessarily mean price must reverse.
A quiet width regime does not guarantee expansion.
A bullish or bearish bias does not predict future direction.
Use this tool together with your own market context and risk management.

No financial advice.

This open-source script was written from scratch using Pine Script built-ins. No third-party Pine code was reused.


日本語補足:

Keltner Channel ATR Stretch は、EMAを中心にATR幅のチャネルを表示しながら、価格の伸び、EMAの傾き、チャネル幅の状態を同時に確認するためのインジケーターです。

右上のDashboardでは、Bias、Position、Volatilityを中心に、現在のチャート状態をすばやく確認できます。

Bias はATRで正規化したEMAの傾きです。
Position は価格がチャネル内、トレンドゾーン、押し目、上方向または下方向の伸び、極端な伸びのどこにあるかを示します。
Volatility はチャネル幅がQuiet、Normal、Expandedのどの状態にあるかを示します。

このスクリプトは売買システムではありません。
BUY/SELL、エントリー、利確、損切りを指示するものではなく、トレンド・行き過ぎ・ボラティリティの状態を読みやすくするための視覚補助ツールです。

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。