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
Watch it run · EURUSD · 1h bars
fastslow

Sample data. Not a result. The real AlgoBarsX engine ran this exact script on made-up bars, and this replays what it drew and did. It shows no profit or loss, and it says nothing about how the script would do in a real market.

Replay of this script on 150 sample bars: 2 lines drawn.

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