# Trend Ribbon

> Trend Ribbon is an indicator drawn over the price chart.

Source: https://algobarsx.com/docs/ex-00-trend-ribbon/

```algobarsx
indicator "Trend Ribbon"
    pane: price

input fast = 20
input slow = 50

fast_line = ema(close, fast)
slow_line = ema(close, slow)

export up = fast_line > slow_line
export strength = (fast_line - slow_line) / atr(14)

plot fast_line as fast, color: if up then green else red
plot 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`.
