# Draw what you see on the chart.

> An indicator works something out and draws it. In AlgoBarsX your indicator can also hand its values to your strategies and alerts, so you write a filter once and use it everywhere.

Source: https://algobarsx.com/indicators/

## A full indicator. Thirteen lines.

Two lines on the chart. The fast one turns green when it is above the slow one, and red when it is below.

- `export` shares a value with other scripts
- `plot` draws it, and the colour can follow a rule
- Inputs become settings anyone can change

```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
```

The compiler reads it back:

> 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`.

## Much more than lines.

There are 26 drawing commands.

- **Lines, fills and zones** Plots, filled bands, boxes, levels, labels and marks. [Read more](https://algobarsx.com/docs/drawing/)
- **Trader tools** Fibonacci levels, pitchforks, channels and volume profiles, drawn from code. [Read more](https://algobarsx.com/docs/ref-cmd-drawing/)
- **Tables and dashboards** Put live numbers on the chart in a tidy panel. Show many bar sizes side by side. [See the example](https://algobarsx.com/docs/ex-51-multi-timeframe-table/)
- **Heatmaps** Colour the chart by volume, volatility or anything you can work out. [See the example](https://algobarsx.com/docs/ex-39-volume-heatmap/)
- **A free canvas** When no command fits, draw your own shapes and text for the part of the chart on screen. [Read more](https://algobarsx.com/docs/drawing/)
- **137 built-in functions** Moving averages, momentum, volatility, volume, statistics, market structure and smart money concepts. [Browse them](https://algobarsx.com/docs/#reference)

## Write it once. Use it everywhere.

A strategy pulls in your indicator by name and version. It sets the inputs, then reads the values like any other number. If you update the indicator later, scripts that named the old version keep working.

You can also read other bar sizes and other markets. A value from a 4-hour bar only shows up once that candle has closed, so a 5-minute rule can never peek at it early.

## Learn by example.

- [Trend Ribbon](https://algobarsx.com/docs/ex-00-trend-ribbon/)
- [MACD Histogram](https://algobarsx.com/docs/ex-15-macd-histogram/)
- [Opening Range Dashboard](https://algobarsx.com/docs/ex-27-opening-range-dashboard/)
- [Volatility Regime Canvas](https://algobarsx.com/docs/ex-30-volatility-regime-canvas/)
- [X-Ray Flow Bands](https://algobarsx.com/docs/ex-43-xray-flow-bands/)
- [All examples](https://algobarsx.com/docs/#examples)

## Good questions.

**Do I need to know how to code?** No. The code reads like plain words, it reads itself back in English, and you can type your idea in plain English and press Convert to AlgoBarsX.

**Can I bring an indicator from another platform?** Yes. Paste it and AlgoBarsX rewrites it with a note on every line. Always read the result. See [Convert](https://algobarsx.com/convert/).

**Can I share an indicator without showing the code?** Yes. Save it as a sealed `.abx` file. People can run it but cannot read the code. It still states its name, its inputs and what it does in plain English.

## Important

Trading is risky and you can lose money. AlgoBars is software, not a broker or an adviser. Backtests are hypothetical and leave out spread, fees, swaps and slippage. AlgoBarsX is in beta.
