OPEN-SOURCE SCRIPT
Dual MA Gradient [Gabremoku]

Dual MA Gradient [Gabremoku] is a clean dual moving average overlay designed to highlight not only MA direction and crossover, but also the degree of separation between the two averages through a dynamic gradient ribbon.
The script uses two configurable moving averages and transforms their relationship into a visual ribbon that reacts to:
bullish alignment
bearish alignment
neutral compression
Instead of relying only on a simple crossover, the indicator helps show whether the two averages are:
crossing,
compressing,
or expanding apart
That makes it useful as a compact trend-structure tool for traders who want an at-a-glance read on direction and relative momentum.
What it shows
📈 Two configurable moving averages — each MA can be set independently using:
EMA or SMA
custom length
custom source
🌈 Directional gradient ribbon — the space between the two averages is divided into layered fills that create a smooth visual ribbon.
🟦 Bullish separation — when the fast MA is above the slow MA, the ribbon shifts to bullish color.
🟨 Bearish separation — when the fast MA is below the slow MA, the ribbon shifts to bearish color.
⚪ Compression state — when the spread between the two MAs becomes small enough, the ribbon fades into a neutral state to signal contraction.
🏷️ Status label — optional live label shows the active state:
Compression
Bullish Separation
Bearish Separation
⭕ Cross markers — optional markers can be shown when bullish or bearish MA crosses occur.
Core logic
The indicator is built around three simple but useful ideas:
Which MA is on top
How far apart the two MAs are
Whether the spread is strong enough to be directional or too tight and neutral
A moving average crossover occurs when a shorter-period average crosses a longer-period average, and it is commonly used to identify trend shifts or signal changes in directional bias.
This script goes a step further by emphasizing the spread between the averages. That matters because ribbon spacing is often used as a visual clue for trend structure: when averages are compressed, the market may be in transition or contraction, while a wider directional ribbon can reflect stronger alignment.
How to read it
A practical reading method is:
Compression = the two averages are close together, market may be transitioning or losing directional clarity
Bullish separation = the fast MA is above the slow MA and the ribbon is opening upward
Bearish separation = the fast MA is below the slow MA and the ribbon is opening downward
In many moving-average frameworks:
the cross helps identify the directional shift
the spacing helps evaluate whether that shift is weak or established
a tight ribbon often suggests indecision or a developing transition
Features
✅ Dual moving average framework
✅ SMA or EMA selection for both lines
✅ Fully customizable lengths
✅ Dynamic layered ribbon between MAs
✅ Bullish / bearish / neutral compression states
✅ Optional MA line display
✅ Optional live status label
✅ Optional crossover markers
✅ Built-in bullish and bearish crossover alerts
Notes
This indicator is designed as a trend-visualization tool rather than a complete standalone strategy. Like all moving-average systems, it is inherently lagging, so it is generally more useful for confirming structure and directional bias than for predicting reversals in isolation.
Author: Gabremoku
Pine Script v6
The script uses two configurable moving averages and transforms their relationship into a visual ribbon that reacts to:
bullish alignment
bearish alignment
neutral compression
Instead of relying only on a simple crossover, the indicator helps show whether the two averages are:
crossing,
compressing,
or expanding apart
That makes it useful as a compact trend-structure tool for traders who want an at-a-glance read on direction and relative momentum.
What it shows
📈 Two configurable moving averages — each MA can be set independently using:
EMA or SMA
custom length
custom source
🌈 Directional gradient ribbon — the space between the two averages is divided into layered fills that create a smooth visual ribbon.
🟦 Bullish separation — when the fast MA is above the slow MA, the ribbon shifts to bullish color.
🟨 Bearish separation — when the fast MA is below the slow MA, the ribbon shifts to bearish color.
⚪ Compression state — when the spread between the two MAs becomes small enough, the ribbon fades into a neutral state to signal contraction.
🏷️ Status label — optional live label shows the active state:
Compression
Bullish Separation
Bearish Separation
⭕ Cross markers — optional markers can be shown when bullish or bearish MA crosses occur.
Core logic
The indicator is built around three simple but useful ideas:
Which MA is on top
How far apart the two MAs are
Whether the spread is strong enough to be directional or too tight and neutral
A moving average crossover occurs when a shorter-period average crosses a longer-period average, and it is commonly used to identify trend shifts or signal changes in directional bias.
This script goes a step further by emphasizing the spread between the averages. That matters because ribbon spacing is often used as a visual clue for trend structure: when averages are compressed, the market may be in transition or contraction, while a wider directional ribbon can reflect stronger alignment.
How to read it
A practical reading method is:
Compression = the two averages are close together, market may be transitioning or losing directional clarity
Bullish separation = the fast MA is above the slow MA and the ribbon is opening upward
Bearish separation = the fast MA is below the slow MA and the ribbon is opening downward
In many moving-average frameworks:
the cross helps identify the directional shift
the spacing helps evaluate whether that shift is weak or established
a tight ribbon often suggests indecision or a developing transition
Features
✅ Dual moving average framework
✅ SMA or EMA selection for both lines
✅ Fully customizable lengths
✅ Dynamic layered ribbon between MAs
✅ Bullish / bearish / neutral compression states
✅ Optional MA line display
✅ Optional live status label
✅ Optional crossover markers
✅ Built-in bullish and bearish crossover alerts
Notes
This indicator is designed as a trend-visualization tool rather than a complete standalone strategy. Like all moving-average systems, it is inherently lagging, so it is generally more useful for confirming structure and directional bias than for predicting reversals in isolation.
Author: Gabremoku
Pine Script v6
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。