math.random() - Pine Script Function
math.random()
Section titled “math.random()”Overview
Section titled “Overview”Returns a pseudo-random value. The function will generate a different sequence of values for each script execution. Using the same value for the optional seed argument will produce a repeatable sequence.
Syntax
Section titled “Syntax”math.random(min, max, seed) → series floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| min | series int/float | The lower bound of the range of random values. The value is not included in the range. The default is 0. |
Returns
Section titled “Returns”A random value.