OPEN-SOURCE SCRIPT
Dynamic Gamma Inspired Indicator

Dynamic Gamma Inspired Indicator
This indicator identifies potential market regime shifts between low-volatility (mean-reverting) and high-volatility (trending) environments by using a dynamic, volatility-adaptive framework inspired by options market gamma exposure concepts.
Core Concepts
This indicator uses a volatility-based model that mimics how market maker hedging can influence price stability and volatility. While it's not possible to calculate true Gamma Exposure (GEX) in Pine Script without external options data, this script uses the Average True Range (ATR) as a proxy to create dynamic zones that adapt to current market conditions.
Positive Gamma Environment (Green Background) When price is contained within the upper and lower walls, it suggests a period of stability where market makers' hedging may suppress volatility. In this "mean-reversion" regime, prices tend to revert to the central pivot.
Negative Gamma Environment (Orange Background) When price breaks outside the walls, it signals a potential increase in volatility, where hedging can amplify price moves. This "trend-amplification" regime suggests the potential for strong breakout or trend-following moves.
How It Works
The indicator is built on three key components that dynamically adjust to market volatility:
Dynamic Pivot (Blue Line) An Exponential Moving Average (EMA) acts as the central "zero gamma" pivot point.
Dynamic Walls (Red & Green Lines) These upper and lower bands are calculated by adding or subtracting a multiple of the Average True Range (ATR) from the central EMA pivot. This is similar to how Keltner Channels use ATR to create volatility-based envelopes. The walls expand during high volatility and contract during low volatility.
How to Use This Indicator
The indicator automatically plots signals based on the current market regime:
Mean-Reversion Signals (Inside the Walls)
Long Reversion: Appears when the price crosses up through the central pivot, suggesting a potential move toward the upper wall.
Short Reversion: Appears when the price crosses down through the central pivot, suggesting a potential move toward the lower wall.
Breakout Signals (Outside the Walls)
Long Breakout: Appears when the price breaks and closes above the upper wall, signaling the start of a potential uptrend.
Short Breakout: Appears when the price breaks and closes below the lower wall, signaling the start of a potential downtrend.
Customization
You can tailor the indicator to different assets and timeframes by adjusting the following inputs:
Central Pivot EMA Length: Determines the period for the central moving average.
ATR Length for Walls: Sets the lookback period for the Average True Range calculation.
ATR Multiplier for Walls: Adjusts the width of the channel. A larger multiplier creates wider walls, filtering out more noise but providing fewer signals.
Disclaimer: This indicator is a tool for analysis and should not be used as a standalone trading signal. Always use proper risk management and combine it with other analysis methods. Past performance is not indicative of future results.
This indicator identifies potential market regime shifts between low-volatility (mean-reverting) and high-volatility (trending) environments by using a dynamic, volatility-adaptive framework inspired by options market gamma exposure concepts.
Core Concepts
This indicator uses a volatility-based model that mimics how market maker hedging can influence price stability and volatility. While it's not possible to calculate true Gamma Exposure (GEX) in Pine Script without external options data, this script uses the Average True Range (ATR) as a proxy to create dynamic zones that adapt to current market conditions.
Positive Gamma Environment (Green Background) When price is contained within the upper and lower walls, it suggests a period of stability where market makers' hedging may suppress volatility. In this "mean-reversion" regime, prices tend to revert to the central pivot.
Negative Gamma Environment (Orange Background) When price breaks outside the walls, it signals a potential increase in volatility, where hedging can amplify price moves. This "trend-amplification" regime suggests the potential for strong breakout or trend-following moves.
How It Works
The indicator is built on three key components that dynamically adjust to market volatility:
Dynamic Pivot (Blue Line) An Exponential Moving Average (EMA) acts as the central "zero gamma" pivot point.
Dynamic Walls (Red & Green Lines) These upper and lower bands are calculated by adding or subtracting a multiple of the Average True Range (ATR) from the central EMA pivot. This is similar to how Keltner Channels use ATR to create volatility-based envelopes. The walls expand during high volatility and contract during low volatility.
How to Use This Indicator
The indicator automatically plots signals based on the current market regime:
Mean-Reversion Signals (Inside the Walls)
Long Reversion: Appears when the price crosses up through the central pivot, suggesting a potential move toward the upper wall.
Short Reversion: Appears when the price crosses down through the central pivot, suggesting a potential move toward the lower wall.
Breakout Signals (Outside the Walls)
Long Breakout: Appears when the price breaks and closes above the upper wall, signaling the start of a potential uptrend.
Short Breakout: Appears when the price breaks and closes below the lower wall, signaling the start of a potential downtrend.
Customization
You can tailor the indicator to different assets and timeframes by adjusting the following inputs:
Central Pivot EMA Length: Determines the period for the central moving average.
ATR Length for Walls: Sets the lookback period for the Average True Range calculation.
ATR Multiplier for Walls: Adjusts the width of the channel. A larger multiplier creates wider walls, filtering out more noise but providing fewer signals.
Disclaimer: This indicator is a tool for analysis and should not be used as a standalone trading signal. Always use proper risk management and combine it with other analysis methods. Past performance is not indicative of future results.
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。