Skip to content
Algo Trade Analytics Docs

math.max() - Pine Script Function

Returns the greatest of multiple values.

math.max(number0, number1, ...) → const int
NameTypeDescription
number0
number1
const intA sequence of numbers to use in the calculation.

The greatest of multiple given values.

//@version=6
indicator("math.max", overlay=true)
plot(math.max(close, open))
plot(math.max(close, math.max(open, 42)))