OPEN-SOURCE SCRIPT
Telah dikemas kini 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)
Nota Keluaran
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.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.