Hi,
Anyone able to help converting this into TOS? Thanks in advance!
https://www.tradingview.com/v/ri7P5Cvh/
study("Heikin/Kaufman Strategy ",shorttitle="KAMA",overlay=true)
res1 = input(title="Heikin Ashi EMA Time Frame", type=resolution, defval="D")
test = input(0,"Heikin Ashi EMA Shift")
sloma = input(20,"Slow EMA Period")
//Kaufman MAK
Length = input(5, minval=1)
xPrice = input(hlc3)
xvnoise = abs(xPrice - xPrice[1])
Fastend = input(2.5,step=.5)
Slowend = input(20)
nfastend = 2/(Fastend + 1)
nslowend = 2/(Slowend + 1)
nsignal = abs(xPrice - xPrice[Length])
nnoise = sum(xvnoise, Length)
nefratio = iff(nnoise != 0, nsignal / nnoise, 0)
nsmooth = pow(nefratio * (nfastend - nslowend) + nslowend, 2)
nAMA = nz(nAMA[1]) + nsmooth * (xPrice - nz(nAMA[1]))
//Heikin Ashi Open/Close Price
ha_t = heikinashi(tickerid)
ha_close = security(ha_t, period, nAMA)
mha_close = security(ha_t, res1, hlc3)
//Moving Average
fma = ema(mha_close[test],1)
sma = ema(ha_close,sloma)
plot(fma,title="MA",color=black,linewidth=2,style=line)
plot(sma,title="SMA",color=red,linewidth=2,style=line)
plotshape(crossover(fma,sma), style=shape.triangleup, location=location.belowbar, size=size.small, color=green, text="B")
plotshape(crossunder(fma,sma), style=shape.triangledown, location=location.abovebar, size=size.small, color=red, text="S")