map.contains() - Pine Script Function
map.contains()
Section titled “map.contains()”Overview
Section titled “Overview”Returns true if the key was found in the id map, false otherwise.
Syntax
Section titled “Syntax”map.contains(id, key) → series boolParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | any map type | A map object. |
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("map.includes example")a = map.new<string, float>()a.put("open", open)p = closeif map.contains(a, "open") p :=a.get("open")plot(p)