HESU - How EMA's are Supposed To Be Used
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Celar

//@version=4
study("How EMA's are Supposed To Be Used", shorttitle='HESU')
vol = sma(volume, 10)
rock = roc(vol, 5)
ema20 = ema(close, 20)
sma50 = sma(close, 50)
max = highest(close, 50)

color1 = rock[1] < rock or rock[2] < rock[1] or rock[3] < rock[2] or max[1]< max ? ema20 > sma50 and max[10]<max ? color.green : color.red : color.red

x = plot(ema20, color = color.blue, linewidth = 3)
y = plot(sma50, color = color.orange)
fill(x, y, color=color1, transp = 60)
