shapes

This lets you place markers or icons directly on your chart, like arrows, circles, or text labels. Think of it as a way to visually highlight signals: for example, put a green arrow below the bar when you want to show a “buy signal,” or a red arrow above the bar for a “sell signal”.

Syntax

plot.shapes(title, value, text, color, textColor, plottype, location, transparency?, id?)

Parameters

  • title string — Name of the shape series (shown in settings).

  • value number — The bar or point where the shape should appear.

  • text string — Text label to show with the shape (optional, can be empty).

  • color string — Color of the shape (like "green" or "rgba(0,255,0,0.8)").

  • textColor string — Color of the text label.

  • plottype PlotShapeId — What kind of shape to draw (arrow up, arrow down, circle, square, etc.).

  • location MarkLocation — Where to place the shape (above bar, below bar, on price).

  • transparency number (optional) — How transparent the shape should be (0 = solid, higher = more transparent).

  • id string (optional) — Custom identifier if you want control.

Return Value

{ value, id } — The shape data and its identifier.

Example

Result

Tips

  • Use arrows for buy/sell, circles or labels for special events.

  • You can mix shapes and text: for example, a red arrow with “Sell” on it.

Warning

Good Practice

Last updated