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, size, offset?, 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 (string) β€” What kind of shape to draw (arrow up, arrow down, circle, square, etc.).

    • shape_arrow_down

    • shape_arrow_up

    • shape_circle

    • shape_cross

    • shape_xcross

    • shape_diamond

    • shape_flag

    • shape_square

    • shape_label_down

    • shape_label_up

    • shape_triangle_down

    • shape_triangle_up

  • location MarkLocation (string) β€” Where to place the shape (above bar, below bar, on price).

    • AboveBar

    • BelowBar

    • Top

    • Bottom

    • Right

    • Left

    • Absolute

    • AbsoluteUp

    • AbsoluteDown

  • size PlotSymbolSize (string) Size of the shape.

    • auto

    • tiny

    • small

    • normal

    • large

    • huge

  • offset number (Optional) Bar offset. Positive values move the shape to the right, negative values to the left.

  • 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

circle-info

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.

triangle-exclamation

Warning

circle-check

Good Practice

Last updated