Lipi Reference
Lipi

Functions

array.max()

Returns the largest element. With `nth`, returns the nth largest instead, counting from 0.

Syntax

                array.max(series array id, series int nth) → series float
              

Arguments

id required series array
nth series int

Return Type

series float

Example


          //@lipi=2
indicator("array.max Example", overlay=true)
prices = array.from(open, high, low, close)
plot(array.max(prices), title="Largest (High)", color=color.green)
plot(array.max(prices, 1), title="Second Largest", color=color.lime)