Please create mql4 version of this indicator:
study(title="PriceSMA", shorttitle="PriceSMA")
smaLength=input(title="SMA Length", defval=8, type=integer)
distance = close-(ema(close, smaLength))
outline = sma(distance, 1)
plot(distance, color = distance < 0 ? red : green, linewidth=2, style=histogram, transp=0)
plot(outline, color=black, linewidth=1, transp=0)
//hline(0.005, color=green, linestyle=solid, linewidth=2)
hline(0, color=black, linestyle=solid, linewidth=1)
//hline(-0.005, color=red, linestyle=solid, linewidth=2)