TradeZoro
Notifications

Cookbook

Supertrend

A built-in trend line that flips color.

//@zscript 1
indicator("Supertrend", overlay=true)
[st, dir] = ta.supertrend(3.0, 10)
plot(st, "Supertrend", color=dir < 0 ? color.green : color.red, linewidth=2)
50305038504550525060
Sample bars, not market data. Supertrend.

How it works

dir is -1 in an up-trend and 1 in a down-trend. We use it to choose the color.

Education only. Not financial advice. Examples are teaching samples, not trading results.

Zscript is coming soon

The manual opens when Zscript launches.

Back to home