Coming from Pine Script
The usual Pine words and what Vex writes instead.
For AI tools: this page as Markdown · the whole language in one file
Vex is not Pine, but most indicators translate line by line. Search this manual for a Pine name (ta.crossover, nz, hline) to find the Vex one.
| Pine | Vex |
|---|---|
//@version=5 | //@vex=1 (optional) |
indicator("T", overlay = true) | name("T", where = chart) |
input.int(14, "Length", minval = 1) | length = int(14, "Length", min = 1) |
input.float, input.bool, input.source, input.color | float(...), bool(...), source(close, ...), color(...) |
input.string("EMA", options = ["EMA", "SMA"]) | average = string("EMA" or "SMA", "Average") |
x[1], x[n] | prev(x), prev(x, n) |
var s = 0 then s := ... | s starts 0 then s = ... prev(s) ... |
c ? a : b | c ? a : b (or if c then a else b) |
na, na(x), nz(x, y) | none, empty(x), fallback(x, y) |
ta.ema, ta.rsi, ta.atr, ... | ema, rsi, atr, ... |
ta.crossover, ta.crossunder | crosses_above, crosses_below |
plot, hline, fill, plotshape | plot, level, fill, mark |
barcolor, bgcolor | bar_color, background |
color.new(col, 80) on a fill | fill(a, b, color = col, opacity = 20) |
color.lime, color.aqua, ... | lime, aqua, ... |
alertcondition(c, title, msg) | alert(c, "message") |
for i = 1 to n: score += x > x[i] ? 1 : -1 | loop_score(x, 1, n) |
barstate.isconfirmed | closed |
request.security(syminfo.tickerid, "240", x) | timeframe("4h", x) |
request.security("ETHUSDT", timeframe.period, close) | symbol("ETHUSDT", close) |
Not in Vex (yet): loops in general, tables and strategies. The editor's robot button copies a prompt that translates a Pine script for you.
See also: Writing scripts with an AI, Values that carry over: starts, Settings


