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
نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
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)