Comment on page

Code: AB EMA Ribbon

A custom exponential moving average (EMA) indicator plots seven EMAs of different periods on the chart, creating a ribbon-like effect. The periods of the EMAs are user-defined and range from 3 to 200. The default values are 3, 9, 17, 33, 42, 69, and 200. The source of the price data is also user-defined, and the default value is the closing price. The indicator also allows the user to drop the number of candles from the chart's beginning. The indicator overlays the chart, providing visual cues for trend direction, support, and resistance levels. The different colours of the EMAs in the ribbon can be customized by changing the hexadecimal colour codes in the script.
// © AlphaBlock Network
indicator(title='AlphaBlock EMA Ribbon', shorttitle='ABEMA Ribbon', overlay=true)
dropn(src, n) =>
na(src[n]) ? na : src
length1 =, title='MA-1 period', minval=1)
length2 =, title='MA-2 period', minval=1)
length3 =, title='MA-3 period', minval=1)
length4 =, title='MA-4 period', minval=1)
length5 =, title='MA-5 period', minval=1)
length6 =, title='MA-6 period', minval=1)
length7 =, title='MA-7 period', minval=1)
src = input(close, title='Source')
dropCandles =, minval=0, title='Drop first N candles')
price = dropn(src, dropCandles)
plot(ta.ema(price, length1), title='MA-1',, 0), linewidth=1)
plot(ta.ema(price, length2), title='MA-2',, 0), linewidth=1)
plot(ta.ema(price, length3), title='MA-3',, 0), linewidth=1)
plot(ta.ema(price, length4), title='MA-4',, 0), linewidth=1)
plot(ta.ema(price, length5), title='MA-5',, 0), linewidth=1)
plot(ta.ema(price, length6), title='MA-6',, 0), linewidth=1)
plot(ta.ema(price, length7), title='MA-7',, 0), linewidth=1)