Skip to content
Algo Trade Analytics Docs

map.size() - Pine Script Function

Returns the number of key-value pairs in the id map.

map.size(id) → series int
NameTypeDescription
idany map typeA map object.
//@version=6
indicator("map.size example")
a = map.new<int, int>()size = 10
for i = 0 to size
a.put(i, size-i)
plot(map.size(a))