Static Visual Declarations
plot, hline, plotshape, plotchar, plotarrow, fill, and linefill.new — the default choice for row-aligned indicator visuals.
Static Declarations: Default Choice for Most Indicators#
Use static declarations when a column in the prepared frame already describes the line, marker, or threshold you want to render. This gives you the cleanest code and the strongest alignment between compute and display.
When to use static declarations#
- The visual maps 1-to-1 with a computed column (e.g. an EMA line, an RSI value, a signal marker).
- The indicator produces one value or one marker per bar.
- You do not need object endpoints, geometry bounds, or mutable text.
Available static APIs#
| API | Use for |
|---|---|
plot(...) | Continuous line or area series from a frame column. |
hline(...) | Fixed horizontal reference line at a constant price level. |
plotshape(...) | Discrete shape markers (circles, triangles, arrows) on signal rows. |
plotchar(...) | Single character markers positioned on signal rows. |
plotarrow(...) | Up/down arrow markers sized by a numeric column. |
fill(...) | Fill the area between two existing plot outputs. |
linefill.new(...) | Fill the area between two existing line objects. |
If the frame already has the column, stay with plot. Reaching for ctx.line.new to draw a line that could
be expressed as plot("ema_fast", ...) adds unnecessary complexity.