OPEN-SOURCE SCRIPT

super super123

279
//version=5
indicator("Supertrend", overlay=true, timeframe="", timeframe_gaps=true)

atrPeriod = input(11, "ATR Length")
factor = input.float(2.0, "Factor", step = 0.01)

[supertrend, direction] = ta.supertrend(factor, atrPeriod)

bodyMiddle = plot((open + close) / 2, display=display.none)
upTrend = plot(direction < 0 ? supertrend : na, "Up Trend", color = color.green, style=plot.style_linebr)
downTrend = plot(direction < 0? na : supertrend, "Down Trend", color = color.red, style=plot.style_linebr)

fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps=false)
fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps=false)

atr_2 = input(10, "ATR Length 2")
factor_2 = input.float(1.0, "Factor 2", step = 0.01)

[supertrend_2, direction_2] = ta.supertrend(factor_2, atr_2)

bodyMiddle_2 = plot((open + close) / 2, display=display.none)
upTrend_2 = plot(direction_2 < 0 ? supertrend_2 : na, "Up Trend", color = color.green, style=plot.style_linebr)
downTrend_2 = plot(direction_2 < 0? na : supertrend_2, "Down Trend", color = color.red, style=plot.style_linebr)

fill(bodyMiddle_2, upTrend_2, color.new(color.green, 90), fillgaps=false)
fill(bodyMiddle_2, downTrend_2, color.new(color.red, 90), fillgaps=false)

atrPeriod_3 = input(12, "ATR Length 3")
factor_3 = input.float(3.0, "Factor 3", step = 0.01)

[supertrend_3, direction_3] = ta.supertrend(factor_3, atrPeriod_3)

bodyMiddle_3 = plot((open + close) / 2, display=display.none)
upTrend_3 = plot(direction_3 < 0 ? supertrend_3 : na, "Up Trend", color = color.green, style=plot.style_linebr)
downTrend_3 = plot(direction_3 < 0? na : supertrend_3, "Down Trend", color = color.red, style=plot.style_linebr)

fill(bodyMiddle_3, upTrend_3, color.new(color.green, 90), fillgaps=false)
fill(bodyMiddle_3, downTrend_3, color.new(color.red, 90), fillgaps=false)

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.