Sidechair

shape.* constants

Browse the reference

The twelve marker shapes plotshape() can draw: arrows, triangles, circle, cross, diamond, flag, square, xcross and two label forms.

Try it in the editor

shape.* constants go in plotshape()'s style argument. The marker is placed by the location argument (location.abovebar, location.belowbar, location.top, location.bottom or location.absolute) and sized by size.* constants. shape.labelup and shape.labeldown draw a text bubble that holds the text argument; the other shapes show text next to the marker.

shape.xcross is plotshape's default style. The arrow shapes point in the direction in their name: shape.arrowup points up, so it usually belongs below the bar.

Constants

NameValueDescription
shape.arrowdownA downward arrow.
shape.arrowupAn upward arrow.
shape.circleA filled circle.
shape.crossA plus-shaped cross.
shape.diamondA filled diamond.
shape.flagA small flag.
shape.labeldownA text bubble with its pointer facing down.
shape.labelupA text bubble with its pointer facing up.
shape.squareA filled square.
shape.triangledownA downward-pointing triangle.
shape.triangleupAn upward-pointing triangle.
shape.xcrossAn x-shaped cross; plotshape's default.

Remarks

  • plotshape draws a marker on every bar where its series is true. Feed it a boolean condition to mark events; a plain number is not accepted in version 6, so write close > open rather than the price series itself.
  • The shapes are fixed; for arbitrary text or a custom position, use label.new instead.

Examples

Pine ScriptMark crossoversOpen in editor
//@version=6
indicator("Cross markers", overlay = true)
fast = ta.sma(close, 10)
slow = ta.sma(close, 30)
plot(fast, "Fast", color.blue)
plot(slow, "Slow", color.orange)
plotshape(ta.crossover(fast, slow), "Up", shape.triangleup, location.belowbar, color.green, size = size.small)
plotshape(ta.crossunder(fast, slow), "Down", shape.triangledown, location.abovebar, color.red, size = size.small)
Pine ScriptTest a number before marking itOpen in editor
//@version=6
indicator("Volume spikes", overlay = true)
spike = volume > ta.sma(volume, 20) * 2
plotshape(spike, "Spike", shape.diamond, location.abovebar, color.orange, size = size.tiny)

See also

Runs on Sidechair