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?) → floatParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
min | float | No | — | Lower bound (default 0). |
max | float | No | — | Upper bound (default 1). |
seed | int | No | — | Optional seed. The same seed reproduces the same sequence; omitting it draws from the unseeded stream. |
Returns
floatExample
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.