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")