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에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//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")