# Getting started

What Vex is, and your first script.

Vex is BackQuant's language for chart indicators. You write formulas, then say what to draw; the chart works out the rest: the settings, where it draws, the colors. Scripts run in your browser on the chart's own bars, on every tick, and use BackQuant data (`gex`, `oi`, `funding`, ...) like any price.

**A whole indicator**

```vex
name("My RSI")

length = 14

gain = max(close - prev(close), 0)
loss = max(prev(close) - close, 0)
rsi = 100 - 100 / (1 + rma(gain, length) / rma(loss, length))

plot(rsi, "RSI", color = blue)
level(70, 30)
```

- `name("My RSI")` names the script: the legend and the indicator list show it.
- `length = 14` is a plain number at the top, so it is a setting you can change on the chart.
- `prev(close)` is the close of the bar before.
- `plot(...)` draws a value. RSI isn't a price, so it gets its own pane.
- `level(70, 30)` draws two dashed lines.

To run it: open the Script Editor (the SCRIPT command, or the code button on a chart's toolbar), write the script, and tick a chart under Add to chart. Each chart runs it with its own settings. Your scripts are also listed under My scripts in every chart's Indicators dialog.

See also: [Settings](/documentation/vex/settings), [Drawing](/documentation/vex/drawing), [Coming from Pine Script](/documentation/vex/coming-from-pine-script), [Writing scripts with an AI](/documentation/vex/writing-scripts-with-an-ai)
