Lines, Polylines & Shapes
Drawing Dynamic Lines
You can draw programmatic lines connecting two specific bar/price pairs or chart.point anchors using the line.new API, inspect ray values with line.get_price(), and set ray extensions (extend.right, extend.left, extend.both).
const myLine = line.new(x1, y1, x2, y2, color, style, width);
const projected = line.get_price(myLine, bar_index);x1, x2: Bar indices (or epoch timestamps when paired withxloc.bar_time/chart.point.from_time).y1, y2: Price coordinates.style:'solid','dashed', or'dotted'.
Shading Between Lines
You can fill the background area between two generated lines using linefill.new.
linefill.new(line1, line2, color)Note that line1 and line2 must be references returned by line.new.
Chart Points (chart.point.*) (v1.0.6)
Construct reusable coordinate anchors backed by bar index, UNIX timestamp, or copies:
chart.point.new(time, index, price)chart.point.from_index(index, price)chart.point.from_time(time, price)chart.point.copy(point)
Polylines & Polygons (v1.0.6)
Draw curved or closed multi-vertex shapes across an array of chart.point anchors:
polyline.new(points, curved, closed, xloc, line_color, fill_color, line_style, line_width)polygon.new(points, color, fill_color, width)/ctx.polygon.new(...)
Programmatic Fibonacci Tools (fib.new) (v1.0.6)
Instantiate fib.new with two chart.point anchors or four numeric coordinates, then dynamically update levels via .set_levels(), .set_color(), .set_extend(), .set_first_point(), and .set_second_point().
Box & Label Interactive Tooltips
Both box.new and label.new support Pine tooltip= strings (plus ctx.registerTooltip and is_hovered() for canvas widgets) so traders can inspect metadata directly on hover. See Drawings & Colors for full signatures.