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.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
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")