Skip to content
Algo Trade Analytics Docs
Pine library page — review pending. This page is preserved for compatibility but is not part of the reviewed search index. Check the official Pine Script v6 reference before relying on its explanation, signature, or example.

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)))