CapnOscar

Arnaud Legoux Moving Average Bands MTF V3

297
Ok I got it.. This is final with ALMA Bands.. You can ignore last 2 because this one covers all if you are interested.. If you like to know why I prefer ALMA for Bands this website may give you some insight. www.arnaudlegoux.com/
Open-source script

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.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study(title = "Arnaud Legoux Moving Average Bands MTF V3", shorttitle="ALMAB MTF V3", overlay=true)
// Default TF is 4 Hrs
source = close

windowsize = input(title="Window Size", type=integer, defval=100)
offset = input(title="Offset", type=float, defval=0.85)
sigma = input(title="Sigma", type=float, defval=6)
picktf = input(title="Pick TimeFrame", type=resolution, defval="240")

ATRlength = input(100, minval=1)
ATRMult = input(2, minval=1)
ATRMult2 = input(4, minval=1)
ATRMult3 = input(6, minval=1)
ATR = rma(tr(true), ATRlength)

almamed = alma(source, windowsize, offset, sigma)


emaup = almamed+(ATR*ATRMult)
emadw = almamed-(ATR*ATRMult)
emahigh = almamed+(ATR*ATRMult2)
emalow = almamed-(ATR*ATRMult2)
emahighx = almamed+(ATR*ATRMult3)
emalowx = almamed-(ATR*ATRMult3)
almatfpv = security(tickerid,picktf ,almamed)
almatfup = security(tickerid,picktf ,emaup)
almatfdw = security(tickerid,picktf ,emadw)
almatfhigh = security(tickerid,picktf ,emahigh)
almatflow = security(tickerid,picktf ,emalow)
almatfhighx = security(tickerid,picktf ,emahighx)
almatflowx = security(tickerid,picktf ,emalowx)


plot(emaup, title="EMAUP", color=red)
plot(emadw, title="EMADW", color=green)
plot(emahigh, title="EMAHigh", color=red)
plot(emalow, title="EMALow", color=green)
plot(emahighx, title="StopLossShort", color=silver)
plot(emalowx, title="StopLossLong", color=silver)

plot(almamed,linewidth=2,color=purple)
plot(almatfup,linewidth=2,color=blue)
plot(almatfdw,linewidth=2,color=blue)
plot(almatfpv,linewidth=2,color=blue)
plot(almatfhigh,linewidth=2,color=red)
plot(almatflow,linewidth=2,color=red)
plot(almatfhighx,linewidth=2,color=silver)
plot(almatflowx,linewidth=2,color=silver)