Skip to main content

Function: shapeEx()

shapeEx(name): ShapeDraw

Place one of the CHART'S OWN drawing tools — a callout, a price label, a Fibonacci retracement — rather than rebuilding its appearance out of lines and labels.

draw.shapeEx("callout") .point(t1, p1).point(t2, p2) .str("text", "supply") .color("textColor", rgba(38, 166, 154)) .draw("ob1")

name is a template the host has registered; which names are accepted is the host's business, not this SDK's, because the list is the host's and would go stale here.

Point count is the TOOL's, not yours. A price label takes one point, a callout two, a Fibonacci retracement three. The host knows each tool's arity and rejects a mismatch; nothing can check it here. Get it wrong and you get an error, not a silent miss.

Property names are the tool's own as well (textColor, backgroundColor, lineColor…), and they are not uniform across tools.

The drawing is owned by the script: locked, not persisted, and removed with the rest of the script's drawings. It is not a user drawing.

Parameters​

name​

string

Returns​

ShapeDraw