NomadandTrader

Bollinger Bands V2 [Super Trend]

################################## Anglais ######################################

With the News Bollinger Bands V2 , you can choose the source of the color (Color with Price or Color with the Super Trend ATR).

You can also view the Super Trend on the chart and the configure.


this allows you to quickly identify trends and the acceleration phase and accumulation

Sorry for my basic English

//J.Dow

################################## Français ######################################



Avec les Nouvelles Bollinger Bands V2 , vous pouvez choisir la source de la couleur ( couleur avec le prix ou la couleur avec le Super Tendance ATR ) .

Vous pouvez aussi consulter le Super Tendance sur le graphique et le configure.


cela vous permet d'identifier rapidement les tendances et la phase d'accélération et d'accumulation

//J.Dow
オープンソーススクリプト

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

免責事項

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

チャートでこのスクリプトを利用したいですか?
//Crée par J.Dow
//Bollinger Band Color + Super Trend
//Version V2
study(shorttitle="Bollinger Bands V2 [Super Trend]", title="Bollinger Bands V2 [Super Trend]", overlay=true)
 
//########################## Parametre  ########################################
src = input(defval=close, title="Source")
length = input(defval=20, minval=1, title ="Boullinger Bands")
mult = input(defval=2.0, minval=0.001, maxval=50)

souc = input(title="Color of the BB with Super Trend", type=bool, defval=false)
Factor=input(title="Super Trend", defval=4, minval=1,maxval = 100)
ATR=input(title="ATR", defval=12, minval=1,maxval = 100)
spt = input(title="View Super Trend on chart", type=bool, defval=false)


//######################## Bollinger Bands #####################################

basis = sma(src, length)
dev = mult * stdev(src, length)
upper = basis + dev
lower = basis - dev

//########################## Super Trend #######################################

Up=hl2-(Factor*atr(ATR))
Dn=hl2+(Factor*atr(ATR))
TUp=src[1]>TUp[1]? max(Up,TUp[1]) : Up
TDown=src[1]<TDown[1]? min(Dn,TDown[1]) : Dn
Trend = src > TDown[1] ? 1: src < TUp[1]? -1: nz(Trend[1],1)
Tsl = Trend==1? TUp: TDown
TslView = spt == true ? Tsl : false
//############################# couleur ##########################################

linecolorATR = Trend == 1 ? green : red
linecolorPrice = src >= basis ? green : red
linecolor = souc == true ? linecolorATR : linecolorPrice

//########################### Affichage ########################################

plot(TslView, color = linecolorATR , style = line , linewidth = 2, title = "SuperTrend")
plot(basis, color=red, transp=75, title="Moving Average")
p1 = plot(upper, color=linecolor, transp=35, title="high band")
p2 = plot(lower, color=linecolor, transp=35, title="Low band")
fill(p1, p2, color=linecolor, transp=95, title="background")