math.max() - Pine Script Function
math.max()
Section titled “math.max()”Overview
Section titled “Overview”Returns the greatest of multiple values.
Syntax
Section titled “Syntax”math.max(number0, number1, ...) → const intParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| number0 | — | — |
| number1 | — | — |
| … | const int | A sequence of numbers to use in the calculation. |
Returns
Section titled “Returns”The greatest of multiple given values.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("math.max", overlay=true)plot(math.max(close, open))plot(math.max(close, math.max(open, 42)))