rmwaddelljr

BB 25 with Barcolors

213
I published this script before. I took a good long look at it and decided this edition could be entitled, "Less is More". If you look at the script there was just too much going on so I took out (//) a lot of the conditions and bar colors in favor of simplicity. The idea is that price tends to bounce off upper or lower bands eventually, so it was in that context I made the edit. If you copy the script feel free to take some of, or all of the (//) to see what you want to see. You might come up with something totally different. The danger, in my opinion,of over editing code from any indicator is that you run the risk of fooling yourself. I made the same adjustment in the BB 100 with Barcolors.
开源脚本

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

免责声明

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

想在图表上使用此脚本?
// BB 25 with Barcolors by Robert Waddell
// I came across an unusual Bollinger Band setup where they use 100 sma and a 25 (not 20) sma.
// I've seen it traded on a 1 hr chart.  I noticed that the combo (100 & 25) produced interesting
// results with bounces off the hourly chart.  you have to load the BB 25 with barcolors
// and the BB 100 with Barcolors seperately.  Also, repo32's "BuySellEMA" is included in the chart
// and provides 8EMA buy/sell signals.  If you see something that needs changing, go for it.


study(title ="BB 25 with Barcolors", overlay = true)
length = input(25, minval=1, title="Length")




TLineEMA = input(8, minval=1, title="Trigger Line")
TLine = ema(close, TLineEMA)
aboveTLine = close > TLine
belowTLine = close < TLine

src = input(close, title="Source")
mult = input(2.0, minval=0.001, maxval=50)
basis = sma(src, length)
dev = mult * stdev(src, length)
source = close
upperBB = basis + dev
lowerBB = basis - dev
b1 = plot(basis, color=gray, linewidth=1)
p1 = plot(upperBB, color=aqua,  linewidth=1)
p2 = plot(lowerBB, color=aqua, linewidth=1)


//ubcrossup = (src[1] < upperBB[1] and src > upperBB[1] ? 1 : 0)
ubcrossdown = (src[1] > upperBB[1] and src < upperBB[1] ? 1 : 0)
lbcrossup = (close[1] < lowerBB[1] and  src > lowerBB ? 1 : 0)
//lbcrossdown = (src[1] > lowerBB[1] and src < lowerBB[1] ? 1 : 0)
//crossupbasis = (src[1] < basis[1] and src > basis[1] and aboveTLine ? 1 : 0)
//crossdownbasis = (src[1] > basis[1] and src < basis[1] ? 1 : 0)
//confirmlbup = (src[2] < lowerBB[2] and src[1] > lowerBB[1] and src > src[1] and aboveTLine ? 1 : 0)
//cnfmaggrlbup = (close[2] < lowerBB[2] and src[1] > lowerBB[1] and close > close[1] and high > high[1] and low > low[1] ? 1 : 0)
//confirmlbdown = (src[2] > lowerBB[2] and src[1] < lowerBB[1] and src < src[1] and belowTLine ? 1 : 0)
//confirmubup = (src[2] < upperBB[2] and src[1] > upperBB[1] and close > close[1] and high > high[1] and low > low[1] and aboveTLine  ? 1 : 0)
//confirmubdown = (src[2] > upperBB[2] and src[1] < upperBB[1] and src < src[1] and belowTLine ? 1 : 0)
//confirmbasisup = (src[2] < basis[2] and src[1] > basis[1] and close > close[1] and high > high[1] and low > low[1] ? 1 : 0)
//confirmbasisdown = (src[2] > basis[2] and src[1] < basis[1] and src < src[1] ? 1 : 0)
//TLineup = (close[1] < TLine[1] and close > TLine ? 1 : 0)

//plotshape(close[2] > TLine[2] and close[1] > TLine and close < TLine, location = location.belowbar, color = fuchsia, style = shape.diamond )
//plotshape(close[2] < TLine[2] and close[1] < TLine[1] and close > TLine, location=location.abovebar, color = lime, style = shape.diamond)


//barcolor(ubcrossup and close > open ? lime : na)
barcolor(ubcrossdown and close < open ? fuchsia : na)
barcolor(lbcrossup and close > open ? lime : na)
//barcolor(TLineup and close > open ? blue : na)
//barcolor(lbcrossdown and close < open ? red : na)
//barcolor(crossupbasis and close > open ? lime : na)
//barcolor(crossdownbasis and close < open ? red : na)
//barcolor(confirmlbup ? yellow : na)
//barcolor(confirmlbdown ? fuchsia : na)
//barcolor(confirmubup ? yellow : na)
//barcolor(confirmubdown ? fuchsia : na)
//barcolor(confirmbasisup ? yellow : na)
//barcolor(confirmbasisdown ? fuchsia : na)
//barcolor(cnfmaggrlbup ? blue : na)