Skip to content
Algo Trade Analytics Docs

map.copy() - Pine Script Function

Creates a copy of an existing map.

map.copy(id) → map<keyType, valueType>
NameTypeDescription
idany map typeA map object to copy.

A copy of the id map.

//@version=6
indicator("map.copy example")
a = map.new<string, int>()a.put("example", 1)b = map.copy(a)a := map.new<string, int>()a.put("example", 2)
plot(a.get("example"))
plot(b.get("example"))