Re: Bollinger Bands type indicators for MT4

1474
mrtools wrote: Tue Dec 20, 2022 11:31 am Not sure what type of channel that is don't think a donchian channel would work.
I found it Mr Tools :In Love:

Code: Select all

//@version=2
study("Motion To Attraction Channels",shorttitle="MTA-Channels",overlay=true)
length = input(14)
//
alpha = 1/length
a = close > nz(A[1],close) ? close : nz(a[1],close)
b = close < nz(B[1],close) ? close : nz(b[1],close)
c = change(b) ? nz(c[1]) + alpha : change(a) ? 0 : nz(c[1])
d = change(a) ? nz(d[1]) + alpha : change(b) ? 0 : nz(d[1])
//
avg = avg(a,b)
A = c*avg+(1-c)*a
B = d*avg+(1-d)*b
//
plot(A,color=#0080FF,transp=0),plot(B,color=#FF0040,transp=0) 
Attachments
These users thanked the author Chickenspicy for the post:
Jedidiah
0 + 0 = 0
Infinite / Infinite = 1
1 way to Heaven & it matters

Re: Bollinger Bands type indicators for MT4

1475
chickensword wrote: Wed Dec 21, 2022 6:37 am I found it Mr Tools :In Love:

Code: Select all

//@version=2
study("Motion To Attraction Channels",shorttitle="MTA-Channels",overlay=true)
length = input(14)
//
alpha = 1/length
a = close > nz(A[1],close) ? close : nz(a[1],close)
b = close < nz(B[1],close) ? close : nz(b[1],close)
c = change(b) ? nz(c[1]) + alpha : change(a) ? 0 : nz(c[1])
d = change(a) ? nz(d[1]) + alpha : change(b) ? 0 : nz(d[1])
//
avg = avg(a,b)
A = c*avg+(1-c)*a
B = d*avg+(1-d)*b
//
plot(A,color=#0080FF,transp=0),plot(B,color=#FF0040,transp=0) 
Image
Cool lets see if I can translate it.
These users thanked the author mrtools for the post (total 3):
Chickenspicy, Jimmy, Jedidiah




Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot], domi8262, IBM oBot [Bot], ParallelNative, phnthnhnm, Proximic [Bot], SEMrush [Bot], URS and 80 guests