map.values() - Pine Script Function
map.values()
Section titled “map.values()”Overview
Section titled “Overview”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.
Syntax
Section titled “Syntax”map.values(id) → array<type>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | any map type | A map object. |
Remarks
Section titled “Remarks”- Maps maintain insertion order. The elements within the array returned by this function will also be in the insertion order.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("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.0for value in values ohlc += valueplot(ohlc/4)