plotshape

Marks the bars on which a condition holds, using a shape from a fixed set. The condition is the first argument, which is how you mark some bars and not others without moving the call: like every chart-output function it must be called at the top level.

plotshape(series bool series, const string title, input shape shape, input location location, series color color, input int offset, const string text, series color textcolor, input size size, const bool force_overlay) → void
ParameterTypeRequiredDescription
seriesseries boolyesThe condition. Required. The mark appears where it holds.
titleconst stringnoThe name of the drawing. Const-form.
shapeinput shapenoWhich member of the shape set to draw. Twelve members exist.
locationinput locationnoWhich member of the location set the mark sits at — above the bar, below it, at the pane’s top or bottom edge, or at an absolute price.
colorseries colornoThe mark’s colour. Series-form, so it may differ on every bar.
offsetinput intnoShifts the drawing along the chart. Input-form.
textconst stringnoText carried by the mark. Const-form: one fixed string for every mark, not a per-bar value.
textcolorseries colornoThe colour of that text. Series-form.
sizeinput sizenoWhich member of the size set to draw at.
force_overlayconst boolnoSets this drawing’s overlay, separately from the script-wide setting.

Returns void — void.

indicator("Up bars, marked with a shape")
plotshape(close > open, title = "Up", shape = shape.triangleup, location = location.belowbar, color = color.green, size = size.tiny)

See also text and markers

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade