OPEN-SOURCE SCRIPT
更新済 EMA/SMA Ribbon

This indicator plots a two-line moving-average ribbon built from:
15-period EMA calculated on OHLC4 (Open+High+Low+Close)/4, with no offset
22-period SMA calculated on OHLC4, plotted with an offset of +6 bars
The space between the two averages is filled to form a ribbon:
Green ribbon when the EMA is above the SMA (using the SMA’s plotted/offset position so the color matches what you see on the chart)
Red ribbon when the SMA is above the EMA
Notes / Behavior:
The indicator uses the chart timeframe (no custom timeframe logic).
Because the SMA is intentionally shifted forward by 6 bars, the ribbon color is calculated against the visually aligned SMA so the color reflects the displayed relationship between the two lines.
No crossover markers or dots are plotted (ribbon-only).
How to use:
Use the ribbon color as a quick visual trend bias:
Green generally suggests bullish bias (EMA leading above the shifted SMA)
Red generally suggests bearish bias (EMA below the shifted SMA)
15-period EMA calculated on OHLC4 (Open+High+Low+Close)/4, with no offset
22-period SMA calculated on OHLC4, plotted with an offset of +6 bars
The space between the two averages is filled to form a ribbon:
Green ribbon when the EMA is above the SMA (using the SMA’s plotted/offset position so the color matches what you see on the chart)
Red ribbon when the SMA is above the EMA
Notes / Behavior:
The indicator uses the chart timeframe (no custom timeframe logic).
Because the SMA is intentionally shifted forward by 6 bars, the ribbon color is calculated against the visually aligned SMA so the color reflects the displayed relationship between the two lines.
No crossover markers or dots are plotted (ribbon-only).
How to use:
Use the ribbon color as a quick visual trend bias:
Green generally suggests bullish bias (EMA leading above the shifted SMA)
Red generally suggests bearish bias (EMA below the shifted SMA)
リリースノート
What changedAdded 3 extra EMAs:
EMA 9 (default: orange, slim, solid)
EMA 20 (default: yellow, slim, solid)
EMA 50 (default: green, slim, solid)
Added 3 extra SMAs:
SMA 100 (default: purple, slim, dashed)
SMA 150 (default: blue, slim, dashed)
SMA 200 (default: red, normal thickness, dashed)
Customization added (for each of the 6 new MAs)
Each of the new moving averages has independent controls for:
Length (fully editable)
Color
Line thickness
Line style: Solid / Dotted / Dashed
Dotted uses a dot-style plot.
Dashed is implemented as a dash-step effect (plots the line at intervals) because TradingView plot() does not support true dashed strokes directly.
What did NOT change
The original EMA15 / SMA22 Ribbon logic is unchanged:
same sources (ohlc4)
same lengths (EMA 15 / SMA 22)
same SMA offset behavior (offset 6)
same ribbon color logic (based on what you visually see)
still no cross dot
Why this update matters
This keeps the ribbon as the main trend/condition layer, while adding standard “structure” moving averages (short EMAs + long SMAs) for multi-timeframe context and cleaner discretionary decision support.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。