//version=5 indicator("200 SMA Cloud", overlay=true)
// Input length for moving averages length = 200
// Calculate the 20 SMA and 20 EMA sma200 = ta.sma(close, length) ema200 = ta.ema(close, length)
// Plot the SMA and EMA lines plot(sma200, color=color.red, linewidth=1, title="200 SMA") plot(ema200, color=color.red, linewidth=1, title="200 EMA")
// Fill the area between SMA and EMA to create a cloud bgcolor = (sma200 > ema200) ? color.new(color.red, 90) : color.new(color.red, 90) fill(plot(sma200), plot(ema200), color=bgcolor, title="SMA Cloud")