tongue1

KAMAP percent channel

47 0 2
show the price position of the KAMA channel and the KAMA channel width
Remove from Favorite Scripts Add to Favorite Scripts
study(title="(KAMAP)", shorttitle="KAMA_channel_P", overlay = false)
Length = input(21, minval=1)
xPrice = close
xvnoise = abs(xPrice - xPrice[1])
nfastend = 0.666
nslowend = 0.0645
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]))

mult = input(2.0, minval=0.001, maxval=50)
maLen=input(7,title="maLength")

dev = mult * atr(maLen)
upper = nAMA + dev
lower = nAMA - dev
dis=upper-lower
upline=(high-nAMA)/dis
dnline=(low-nAMA)/dis


plot(0, color=teal)
plot(-0.5,color=gray)
plot(0.5,color=gray)
u=plot(upline,color=blue)
d=plot(dnline,color=blue)
fill(u,d,color=blue)

enlarge=input(500,title="rollback enlarge")

trd=dev*enlarge
u1=plot(1,color=red)
trdUp=plot(1-trd,color=red)
fill(u1,trdUp,color=red)
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out