Skip to content
Algo Trade Analytics Docs

map.values() - Pine Script Function

Returns an array of all the values in the id map. The resulting array is a copy and any changes to it are not reflected in the original map.

map.values(id) → array<type>
NameTypeDescription
idany map typeA map object.
  • Maps maintain insertion order. The elements within the array returned by this function will also be in the insertion order.
//@version=6
indicator("map.values example")
a = map.new<string, float>()a.put("open", open)a.put("high", high)a.put("low", low)a.put("close", close)values = map.values(a)ohlc = 0.0
for value in values ohlc += value
plot(ohlc/4)