chandan.kumar

Multitimeframe Supertrend

6 TImeframe Supertrend lines in one chart(W,D,240,120,60,30 and 15min)

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//Author - Chandan Kumar
//Thanks to Rajandran of www.marketcalls.in for original supertrend script
//Multi time frame supertrend - 6 timeframe supertrends in one chart
study("Multitimeframe Supertrend", overlay = true)

Factor=input(4, minval=1,maxval = 100)
Pd=input(10, minval=1,maxval = 100)

Up=hl2-(Factor*atr(Pd))
Dn=hl2+(Factor*atr(Pd))

TrendUp=close[1]>TrendUp[1]? max(Up,TrendUp[1]) : Up
TrendDown=close[1]<TrendDown[1]? min(Dn,TrendDown[1]) : Dn

Trend = close > TrendDown[1] ? 1: close< TrendUp[1]? -1: nz(Trend[1],1)
Tsl = Trend==1? TrendUp: TrendDown

Trend15 = security(tickerid,"15",Trend)
Trend30 = security(tickerid,"30",Trend)
Trend60 = security(tickerid,"60",Trend)
Trend120 = security(tickerid,"120",Trend)
Trend240 = security(tickerid,"240",Trend)
TrendD = security(tickerid,"D",Trend)
TrendW = security(tickerid,"W",Trend)

Tsl15 = security(tickerid,"15",Tsl)
Tsl30 = security(tickerid,"15",Tsl)
Tsl60 = security(tickerid,"60",Tsl)
Tsl120 = security(tickerid,"120",Tsl)
Tsl240 = security(tickerid,"240",Tsl)
TslD = security(tickerid,"D",Tsl)
TslW = security(tickerid,"W",Tsl)

//linecolor = Trend == 1 ? green : red
linecolor15 = Trend15 == 1 ? green : red
linecolor30 = Trend30 == 1 ? green : red
linecolor60 = Trend60 == 1 ? green : red
linecolor120 = Trend120 == 1 ? green : red
linecolor240 = Trend240 == 1 ? green : red
linecolorD = TrendD == 1 ? green : red
linecolorW = TrendW == 1 ? green : red

plot(Tsl15, color = linecolor15 , style = line , linewidth = 1,title = "SuperTrend15")
plot(Tsl30, color = linecolor30 , style = linebr , linewidth = 1,title = "SuperTrend30")
plot(Tsl60, color = linecolor60 , style = circles, linewidth = 1,title = "SuperTrend60")
plot(Tsl120, color = linecolor120 , style = cross,linewidth = 1,title = "SuperTrend120")
plot(Tsl240, color = linecolor240 , style = line , linewidth = 1,title = "SuperTrend240")
plot(TslD, color = linecolorD , style = line , linewidth = 2,title = "SuperTrendD")
plot(TslW, color = linecolorW , style = line , linewidth = 2,title = "SuperTrendW")
//plotshape(cross(close,Tsl) and close>Tsl , "Up Arrow", shape.triangleup,location.belowbar,green,0,0)
//plotshape(cross(Tsl,close) and close<Tsl , "Down Arrow", shape.triangledown , location.abovebar, red,0,0)
//plot(Trend==1 and Trend[1]==-1,color = linecolor, style = circles, linewidth = 3,title="Trend")

//plotarrow(Trend == 1 and Trend[1] == -1 ? Trend : na, title="Up Entry Arrow", colorup=lime, maxheight=60, minheight=50, transp=0)
//plotarrow(Trend == -1 and Trend[1] == 1 ? Trend : na, title="Down Entry Arrow", colordown=red, maxheight=60, minheight=50, transp=0)