Skip to main content
Everything a script draws comes from the object compute returns. plots is required (it may be empty); every other key is optional.

Plots

A plot is one value per chart bar. Use null where there is no value.

Pane options

Coordinates

Drawings use bar indices for x: 0 is the first bar in bars and bars.length - 1 is the latest. Fractional values and indices past the last bar are allowed, so zones and rays can extend into the future. Y is a price in an overlay pane, or the script’s own value in a separate pane. Boxes and background bands render under the price series. Lines, markers and labels render on top. Everything is clipped to the pane.

Boxes

Use rgba() colors for translucent zone fills.

Labels

Lines

Markers

Background bands

Example: previous-bar breakout markers

Caps

Boxes render in the order you return them, up to 2000 boxes that fall in the visible range. Boxes outside the visible range don’t count, and older zones that extend into view still render. Labels, lines, markers and background bands use the first 2000 items of each type. Keep your output bounded, for example by only emitting recent history. See Limits.