Trend Ribbon

Trend Ribbon is an indicator drawn over the price chart.

core language

trend-ribbon.abx
1indicator "Trend Ribbon"
2pane: price
3
4input fast = 20
5input slow = 50
6
7fast_line = ema(close, fast)
8slow_line = ema(close, slow)
9
10export up = fast_line > slow_line
11export strength = (fast_line - slow_line) / atr(14)
12
13plot fast_line as fast, color: if up then green else red
14plot slow_line as slow, color: gray
What this script says

Trend Ribbon is an indicator drawn over the price chart.

You can change 2 inputs: fast (default 20) and slow (default 50).

It calculates fast_line as the EMA of the close over fast bars, slow_line as the EMA of the close over slow bars, up as whether fast_line is above slow_line and strength as (fast_line minus slow_line) divided by the 14-bar ATR. It shares up and strength with scripts that use it.

On the chart, it plots fast_line as fast and plots slow_line as slow.

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account