yongyuth.rootwararit

yuthavithi bb scalper V2

This is a trend based BB scalper. I notice when the trend is fading and the price is going to leave the upper/lower band, the opposite band will stop expanding and turn back. This can serve as a good point for profit taking.

Like my previous force scalper, this scalper also use ATR to filter sideway period. It will provide buy/sell signal only when the price is trending.

sideway period is indicated by the silver upper/lower band, it does not trade during this period. but provide close signal instead.
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?
study(title="yuthavithi bb scalper V2", shorttitle="YUTHAVITHI BB Scalper V2", overlay=true)
atrFast = input(20, minval = 1, title = "ATR Fast")
atrSlow = input(50, minval = 1, title = "ATR Slow")
bandSmooth = input(1, minval = 1, title = "BB Band Smooth")
len = input(20, minval=1, title="Length")
multiplier = input(2, minval=1, title="multiplier")
src = input(close, title="Source")
bbMid = sma(src, len)


atrFastVal = atr(atrFast)
atrSlowVal = atr(atrSlow)
stdOut = stdev(close, len)
bbUpper = bbMid + stdOut * multiplier
bbLower = bbMid - stdOut * multiplier
bbUpper2 = sma(bbUpper, bandSmooth)
bbLower2 = sma(bbLower, bandSmooth)

trending = atrFastVal > atrSlowVal

buy = trending and (bbMid > bbMid[1]) and (bbUpper > bbUpper[1]) and (bbLower < bbLower[1])
sell = trending and (bbMid < bbMid[1]) and (bbUpper > bbUpper[1]) and (bbLower < bbLower[1])

closeBuy =   (bbMid > bbMid[1]) and (bbLower2 > bbLower2[1]) 
closeSell =  (bbMid < bbMid[1]) and (bbUpper2 < bbUpper2[1]) 

plot(bbMid, color=red)
plot(bbUpper, color = (atrFastVal > atrSlowVal ? red : silver))
plot(bbLower, color = (atrFastVal > atrSlowVal ? red : silver))

plotshape((sell), color=red, style=shape.arrowdown, location=location.abovebar)
plotshape((buy ), color=green, style=shape.arrowup, location=location.belowbar)

plotshape(closeSell, color=purple, style=shape.arrowup, location=location.belowbar)
plotshape(closeBuy, color=blue, style=shape.arrowdown, location=location.abovebar)

plotshape((sell and sell[1] == false), color=red, style=shape.arrowdown, location=location.abovebar, text = "Sell")
plotshape((buy and buy[1] == false ), color=green, style=shape.arrowup, location=location.belowbar, text = "Buy")

plotshape(closeSell and closeSell[1] == false, color=purple, style=shape.arrowup, location=location.belowbar, text = "ClsSell")
plotshape(closeBuy and closeBuy[1] == false, color=blue, style=shape.arrowdown, location=location.abovebar, text = "ClsBuy")