Skip to content
Algo Trade Analytics Docs

map.contains() - Pine Script Function

Returns true if the key was found in the id map, false otherwise.

map.contains(id, key) → series bool
NameTypeDescription
idany map typeA map object.
//@version=6
indicator("map.includes example")
a = map.new<string, float>()a.put("open", open)p = close
if map.contains(a, "open") p :=
a.get("open")
plot(p)