Here are common functions usually delete drawing once array of drawing is recall.
Method is used as in pine script version 5 instead of custom function.
It is an upgrade from DeleteArrayObject, which may not support overload parameter in future.

Library "DeleteArrayType"
TODO: Delete array type especially for drawings

method deleteLabel(id)
  TODO: Delete array<label>
  Namespace types: array<label>
    id (array<label>)
  Returns: TODO: label.delete()

method deleteLine(id)
  TODO: Delete array<line>
  Namespace types: array<line>
    id (array<line>)
  Returns: TODO: line.delete()

method deleteLineFill(id)
  TODO: Delete array<linefill>
  Namespace types: array<linefill>
    id (array<linefill>)
  Returns: TODO: linefill.delete()

method deletePolyLine(id)
  TODO: Delete array<polyline>
  Namespace types: array<polyline>
    id (array<polyline>)
  Returns: TODO: polyline.delete()

method deleteBox(id)
  TODO: Delete array<box>
  Namespace types: array<box>
    id (array<box>)
  Returns: TODO: box.delete()

method deleteTable(id)
  TODO: Delete array<table>
  Namespace types: array<table>
    id (array<table>)
  Returns: TODO: table.delete()

Pine library

In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House Rules.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this library?

Copy the following line and paste it in your script.