OPEN-SOURCE SCRIPT
EMA/SMA Trending 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)
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.