Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.math.random
On this pageSignatureParametersReturnsExample

Math / Reference

alerta.math.random

TradingView-compatible spelling: math.random, runs without warnings

Returns a pseudo-random value in range [min, max]. With `seed`, the sequence is REPEATABLE: the same seed yields the same stream of values on every run, which is what a simulation needs so its paths do not redraw differently on each tick.

alerta.math.random(min?, max?, seed?) → float

Parameters

NameTypeRequiredDefaultDescription
minfloatNo—Lower bound (default 0).
maxfloatNo—Upper bound (default 1).
seedintNo—Optional seed. The same seed reproduces the same sequence; omitting it draws from the unseeded stream.

Returns

float

Example

alerta.math.random
r = random(0, 1)repeatable = random(0, 1, 42)plot(r, { pane: "oscillator" })plot(repeatable, { pane: "oscillator" })

Names and aliases

Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.

AlertaScript

No results found.

Search by name, alias, or keyword.