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| Parameter | Type | Required | Description |
|---|---|---|---|
series | series bool | yes | The condition. Required. The mark appears where it holds. |
title | const string | no | The name of the drawing. Const-form. |
shape | input shape | no | Which member of the shape set to draw. Twelve members exist. |
location | input location | no | Which 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. |
color | series color | no | The mark’s colour. Series-form, so it may differ on every bar. |
offset | input int | no | Shifts the drawing along the chart. Input-form. |
text | const string | no | Text carried by the mark. Const-form: one fixed string for every mark, not a per-bar value. |
textcolor | series color | no | The colour of that text. Series-form. |
size | input size | no | Which member of the size set to draw at. |
force_overlay | const bool | no | Sets 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.