Skip to content
Algo Trade Analytics Docs

array.range() - Pine Script Function

The function returns the difference between the min and max values from a given array.

array.range(id) → series float
NameTypeDescription
idarray<int/float>An array object.

The difference between the min and max values in the array.

  • Returns na if the id array is empty.
//@version=6
indicator("array.range example")
a = array.new_float(0)
for i = 0 to 9
array.push(a, close[i])
plot(array.range(a))