Returns a new chart point with the same index, time and price as an existing one.
Chart points are objects, so assigning one to another variable shares it. A copy breaks that link: edit the copy and the original stays as it was.
Take one before a script nudges a point that other drawings already use, for instance an anchor that is reused to build a channel.
Syntax
chart.point.copy(id: chart.point) -> chart.pointArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | chart. | required | The chart.point to duplicate. The copy gets its own index, time and price fields. |
Returns
chart.point: A new chart.point.
Example
//@version=6
indicator("chart.point.copy: frozen anchor", overlay = true)
var anchor = chart.point.now(close)
frozen = chart.point.copy(anchor)
plot(close - frozen.price, "Gap from anchor")See also
Runs on Sidechair