My MACD
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © csmottola71
//@version=4
study("My MACD")
fMa = input(title="Fast MA", type=input.integer, defval=21)
sMa = input(title="Slow MA", type=input.integer, defval=55)
fm = ema(close, fMa)
sm = ema(close, sMa)
maS = fm - sm
hlc = (high+low+close)/3

cd = hlc - sm
plot(maS, style=plot.style_histogram, color = maS > 0 ? color.green : color.red)
plot(cd, color=color.white)
