Sidechair

chart.copy()

Browse the reference

Method-call spelling of chart.point.copy(): point.copy() returns a new chart.point with the same three fields.

Try it in the editor

chart.copy() is what point.copy() resolves to. Both give a new point with the same index, time and price, and editing the new point leaves the old one alone.

Write the method form in your own code; the long name chart.point.copy() is the one that takes the point as an argument.

Syntax

Pine Script
chart.copy() -> chart.point

Returns

chart.point: A new chart.point with the same index, time and price.

Remarks

  • On Sidechair: chart.copy() warns that it isn't supported yet and gives na, because the points it would copy cannot be created.

Example

Pine ScriptCopy of an anchor pointOpen in editor
//@version=6
indicator("chart.copy: anchor copy", overlay = true)
var p = chart.point.now(close)
q = p.copy()
plot(q.price - p.price, "Difference")

See also

Not on Sidechair yet