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_downshape_arrow_upshape_circleshape_crossshape_xcrossshape_diamondshape_flagshape_squareshape_label_downshape_label_upshape_triangle_downshape_triangle_up
location
MarkLocation (string)β Where to place the shape (above bar, below bar, on price).AboveBarBelowBarTopBottomRightLeftAbsoluteAbsoluteUpAbsoluteDown
size
PlotSymbolSize (string)Size of the shape.autotinysmallnormallargehuge
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

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
If you donβt choose the right
location, your shape might overlap price bars or get lost in the chart.Avoid using too many shapes at once, or your chart will look messy.
Last updated