rmwaddelljr

BB 100 with Barcolors

7
I cleaned up the highlight barcolor to reflect red or lime depending if it closed > or < the open.

The description is in the code. you want to catch bounces off the 25 (upper or lower) and 100 (upper or lower).
Works well on the hourly and 30 min charts. Haven't tested it beyond that. Haven't tested Forex, just equities.
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
// BB 100 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 100 with Barcolors", overlay = true)
length = input(100, minval=1, title="Length") 
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=red,  linewidth=1)
p2 = plot(lowerBB, color=red, linewidth=1)

ubcrossup = (src[1] < upperBB and src > upperBB ? 1 : 0)
ubcrossdown = (src[1] > upperBB and src < upperBB ? 1 : 0)
lbcrossup = (src[1] < lowerBB and src > lowerBB ? 1 : 0)
lbcrossdown = (src[1] > lowerBB and src < lowerBB ? 1 : 0)
crossupbasis = (src[1] < basis and src > basis ? 1 : 0)
crossdownbasis = (src[1] > basis and src < basis ? 1 : 0)


barcolor(ubcrossup and close > open ? lime : na)
barcolor(ubcrossdown and close < open ? red : na)
barcolor(lbcrossup and close > open ? lime : na)
barcolor(lbcrossdown and close < open ? red : na)
barcolor(crossupbasis and close > open ? lime : na)
barcolor(crossdownbasis and close < open ? red : na)