MErhaba aşağıda yer alan kodu system tester için al sat optimize formülünü nasıl yazabiliriz.
//This is a modification of Supersmoothed MACD (created by KIVANC using EHLERS' SUPER SMOOTHER FILTER) and sharpenned with Ehler fisher transform
//all length are completely configurable
//give me what you think
study("SuperSmoothed MACD for STOCKS",shorttitle="Fisher Transform SSMACD")
p = close
len = input(5,minval=1,title="Length")
f = (1.414*3.14159)/len
a = exp(-f)
c2 = 2*a*cos(f)
c3 = -a*a
c1 = 1-c2-c3
ssmooth = c1*(p+p[1])*0.5+c2*nz(ssmooth[1])+c3*nz(ssmooth[2])
len2 = input(21,minval=1,title="Length")
f2 = (1.414*3.14159)/len2
a2 = exp(-f2)
c22 = 2*a2*cos(f2)
c32 = -a2*a2
c12 = 1-c22-c32
ssmooth2 = c12*(p+p[1])*0.5+c22*nz(ssmooth2[1])+c32*nz(ssmooth2[2])
macd = (ssmooth - ssmooth2)
//Fisher Transform of macd
Samples = input(13, minval=2,title='Fisher Transform length')
high_ = highest(macd, Samples)
low_ = lowest(macd, Samples)
round_(val) => val > .99 ? .999 : val < -.99 ? -.999 : val
value = round_(.66 * ((macd - low_) / max(high_ - low_, .001) - .5) + .67 * nz(value[1]))
fish1 = .5 * log((1 + value) / max(1 - value, .001)) + .5 * nz(fish1[1])
len3 = input(5,minval=1,title="Length")
f3 = (1.414*3.14159)/len3
a3 = exp(-f3)
c23 = 2*a3*cos(f3)
c33 = -a3*a3
c13 = 1-c23-c33
ssmooth3 = c13*(fish1+fish1[1])*0.5+c23*nz(ssmooth3[1])+c33*nz(ssmooth3[2])
plot(ssmooth3, color=blue, linewidth=2)
plot(fish1, color=red, linewidth=2)