In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
alertcondition(crossup, title='Buy', message='go long')
alertcondition(crossdn, title='Sell', message='go short')
For starters you can try these:
- this one should be adjusted to avoid repainting: change current hlc3 value to the previous hlc3 value in security func.
gain = input(.5, "Gain", step=.01)
kahlman(x, g) =>
kf = 0.0
dk = x - nz(kf, x)
smooth = nz(kf,x)+dk*sqrt(g*2)
velo = 0.0
velo := nz(velo,0) + (g*dk)
kf := smooth+velo