Object Namespace Methods
box.new, label.new, line.new, polyline.new — object namespace methods for shapes, labels, and geometry in build_visuals.
ctx Object Namespaces: Full Method Reference#
Object namespace methods are called inside build_visuals(...) to emit chart objects assembled from
prepared frame data. Each method returns an intent that the ATK render engine processes.
ctx.line.new#
Creates a line segment between two chart-point coordinates.
ctx.line.new(
key="support_line",
x1=int(anchor["index"]),
y1=float(anchor["low"]),
x2=int(last["index"]),
y2=float(last["low"]),
color="#f23645",
width=1,
style="solid",
)ctx.label.new#
Creates a text label anchored at a chart point.
ctx.label.new(
key="entry_label",
x=int(last["index"]),
y=float(last["close"]),
text="ENTRY",
color="#2962ff",
style="label_up",
size="normal",
)ctx.box.new#
Creates a rectangle defined by top-left and bottom-right corners.
ctx.box.new(
key="range_box",
left=int(start["index"]),
top=float(high_val),
right=int(end["index"]),
bottom=float(low_val),
border_color="#ff9800",
bgcolor="#ff980020",
)ctx.polyline.new#
Creates a multi-segment path through an array of chart points.
ctx.polyline.new(
key="zigzag_path",
points=[{"x": int(r["index"]), "y": float(r["close"])} for _, r in pivots.iterrows()],
color="#9c27b0",
width=2,
)ctx.table.new#
Creates a managed table widget. Prefer this over the ATK bridge table for simple plain widgets.
ctx.table.new(
key="stats_table",
rows=3,
columns=2,
position="top_right",
)Object namespace calls must use stable key values. The render engine uses keys to track and update objects
across bar updates. Avoid generating dynamic keys from bar indices or timestamps.