Appearance
math
Deterministic math helpers. math.random() is seeded per run, so a backtest repeats exactly.
| Name | Description |
|---|---|
math.abs() | Absolute value. |
math.max() | Largest of the arguments. |
math.min() | Smallest of the arguments. |
math.floor() | Rounds down to a whole number. |
math.ceil() | Rounds up to a whole number. |
math.round() | Rounds to digits decimals (default 0). |
math.sqrt() | Square root. |
math.pow() | x to the power y. |
math.log() | Natural logarithm. |
math.exp() | e to the power x. |
math.random() | seeded; seed is part of the run config |
math.abs()
ts
math.abs(x: number): numberAbsolute value.
math.max()
ts
math.max(...xs: number[]): numberLargest of the arguments.
math.min()
ts
math.min(...xs: number[]): numberSmallest of the arguments.
math.floor()
ts
math.floor(x: number): numberRounds down to a whole number.
math.ceil()
ts
math.ceil(x: number): numberRounds up to a whole number.
math.round()
ts
math.round(x: number, digits?: number): numberRounds to digits decimals (default 0).
math.sqrt()
ts
math.sqrt(x: number): numberSquare root.
math.pow()
ts
math.pow(x: number, y: number): numberx to the power y.
math.log()
ts
math.log(x: number): numberNatural logarithm.
math.exp()
ts
math.exp(x: number): numbere to the power x.
math.random()
ts
math.random(): numberseeded; seed is part of the run config
