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
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?
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)