Tradingview da bulunan bir indikatörü matrikse çevirmeye çalıştım fakat aynı sonuçları alamadım.
x1:=input("Alpha Length",1,500,20);
x2:=input("Gamma Length",1,500,20);
alpha:=2/(x1+1);
gamma:=2/(x2+1);
h1:=(1-alpha)*(prev+ref(b1,-1))+alpha*c;
b1:=(1-gamma)*prev+gamma*(h1-ref(h1,-1));
h1
Tradingview formülü
alphaLength = input(title="Alpha Length", type=integer, defval=20, minval=1)
gammaLength = input(title="Gamma Length", type=integer, defval=20, minval=1)
src = input(title="Source", type=source, defval=close)
alpha = 2 / (alphaLength + 1)
gamma = 2 / (gammaLength + 1)
b = 0.0
hema = 0.0
hema := (1 - alpha) * (nz(hema[1]) + nz(b[1], src)) + alpha * src
b := (1 - gamma) * nz(b[1]) + gamma * (hema - nz(hema[1]))
plot(hema, title="HEMA", linewidth=2, color=blue, transp=0)