986 просмотров
There is not much to say - just vanilla locally weighted regression in PineScript 4.
see: https://medium.com/100-days-of-algorithm...
also: http://cs229.stanford.edu/proj2017/final...
see: https://medium.com/100-days-of-algorithm...
also: http://cs229.stanford.edu/proj2017/final...
Комментарии
add line
mmx = input(2, "Scaler Lookback", minval=1) // originally 4
and replace line
pred = scale(lwr(sec, gendata, p, tau), p)
with
pred = scale(lwr(sec, gendata, p, tau), mmx)
add this line:
oft = input(5, "Flag Offset", minval=2)
Then replace this line:
plotshape(not(fl and rs) ? hl2 : na, location=location.absolute, style=shape.flag, color=c, size=size.small, transp=0, offset=3, show_last=1)
with:
plotshape(not(fl and rs) ? hl2 : na, location=location.absolute, style=shape.flag, color=c, size=size.small, transp=0, offset=oft, show_last=1)
plotshape(fl ? hl2: na, location=location.absolute, style=shape.flag, color=c, size=size.small, transp=0, offset=oft, show_last=1)
plotshape(rs ? hl2: na, location=location.absolute, style=shape.flag, color=c, size=size.small, transp=0, offset=oft, show_last=1)
plotshape(not(fl and rs) ? hl2 : na, location=location.absolute, style=shape.flag, color=c, size=size.small, transp=0, offset=oft, show_last=1)