yongyuth.rootwararit

yuthavithi's BB Scalper

A trend based BB scalper. It uses day time frame data to determine trend. When price moves above sma, it is up trend , otherwise it is down trend. the trading signal is determined in lower time frame using bband. In up trend, it will only buy and close when price reaches bb upper band. In downtrend it will do the opposite
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?
study(title="yuthavithi's BB Scalper", shorttitle="YUTHAVITHI BB Scalper", overlay=true)
len = input(20, minval=1, title="Length")
multiplier = input(2, minval=1, title="multiplier")
src = input(close, title="Source")
out = sma(src, len)
plot(out, title="SMA", color=blue)

stdOut = stdev(close, len)
bbUpper = out + stdOut * multiplier
bbLower = out - stdOut * multiplier
plot(bbUpper, color = orange)
plot(bbLower, color = orange)

closeLongTerm = security(tickerid, "D", close)
smaLongTerm = security(tickerid, "D", sma(close,20))


plot(smaLongTerm, color=red)

trendUp = (closeLongTerm > smaLongTerm) 
trendDown = (closeLongTerm < smaLongTerm) 

bearish = (cross(close,out) == 1) and (close[1] > close) and trendDown
bullish = (cross(close,out) == 1) and (close[1] < close) and trendUp

plotshape(bearish, color=red, style=shape.arrowdown, text="Sell", location=location.abovebar)
plotshape(bullish, color=green, style=shape.arrowup, text="Buy", location=location.belowbar)

closeBuy = (high[1] > bbUpper) and (close < bbUpper) and (close < open)
closeSell = (low[1] < bbLower) and (close > bbLower) and (close > open)

plotshape(closeSell, color=red, style=shape.arrowup, text="Close", location=location.belowbar)
plotshape(closeBuy, color=green, style=shape.arrowdown, text="Close", location=location.abovebar)