tongue1

KAMAP percent channel

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)
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
Việt Nam
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Priority Support Contact Support Ideas Published Followers Following Private Messages Chat Sign Out