# Marks, finished bars and alerts

mark() and alert() on yes/no conditions; "and closed" for finished bars.

```vex
name("Crossovers", where = chart)

fast = ema(close, 9)
slow = ema(close, 21)
plot(fast)
plot(slow)
mark(crosses_above(fast, slow) and closed, "B", where = below)
mark(crosses_below(fast, slow) and closed, "S", where = above, color = orange)
alert(crosses_above(fast, slow), "Fast crossed above slow at {close}")
```

A mark can also be a label at a price, with values in its text:

**Swing highs and lows, labelled with their price**

```vex
name("Pivot labels", where = chart)

ph = pivot_high(high, 8, 8)
pl = pivot_low(low, 8, 8)
mark(not empty(ph), "{ph}", at = ph, shape = dot, color = orange, offset = -8)
mark(not empty(pl), "{pl}", at = pl, where = below, shape = dot, color = teal, offset = -8)
```

The newest bar is still forming: its close moves with every trade, so a condition on it can be true one moment and false the next. `closed` is true on finished bars and false on the forming one. Add `and closed` so a mark never appears and then vanishes.

An alert fires once, when a bar closes with its condition true (never for the history loaded with the chart, never in bar replay), while a chart running the script is open. It follows your alert settings: quiet hours, desktop notifications and sound. `{name}` puts a value of the script in the message. The editor's Alerts tab lists what fired.

See also: [mark](/documentation/vex/reference/drawing#mark), [alert](/documentation/vex/reference/drawing#alert), [closed](/documentation/vex/reference/bar-values#closed)
