Professional Documents
Culture Documents
Super Trende
Super Trende
input_group {
"front.ind.dpo.generalline",
up_color = input { default = "#25E154", type = input.color },
down_color = input { default = "#FF6C58", type = input.color },
width = input { default = 1, type = input.line_width }
}
up = hl2 - offset
down = hl2 + offset
trend_up = iff (not na(trend_up) and close [1] > trend_up [1], max (up, trend_up
[1]), up)
trend_down = iff (not na(trend_down) and close [1] < trend_down [1], min (down,
trend_down [1]), down)
trend = iff (close > trend_down [1], true, iff (close < trend_up [1], false,
nz(trend [1], true)))
tsl = iff (trend, trend_up, trend_down) -- supertrend line
Buy = open[1] > close[1] and open < close and open <= close[1] and close > open[1]
and close > tsl
Sell = open[1] < close[1] and open > close and open >= close[1] and close < open[1]
and close < tsl