Skip to main content

types.MarkerShape#

Seven-glyph shape union shared by plot.marker and entity.marker.

SYNTAX#

type MarkerShape = 'circle' | 'square' | 'triangle' | 'triangle-down' | 'diamond' | 'cross' | 'x'

ARGUMENTS#

  • circle ('circle') — Filled circle. The default for plot.marker.
  • square ('square') — Filled square.
  • triangle ('triangle') — Upward-pointing triangle — conventional for buy/long signals.
  • triangle-down ('triangle-down') — Downward-pointing triangle — conventional for sell/short signals.
  • diamond ('diamond') — Filled diamond.
  • cross ('cross') — Plus-shaped cross.
  • x ('x') — Diagonal cross.

RETURNS#

Type definition.

REMARKS#

In the runtime contract this union is declared once as EntityMarkerShape, with PlotMarkerShape as a direct alias — the two surfaces are guaranteed to stay in lockstep.

EXAMPLE#

function onBar(i, ctx) {
  if (i < 1) return;
  if (candles[i].close > candles[i-1].high) {
    plot.marker('breakout', candles[i].high, { shape: 'triangle', color: '#26a69a', size: 8 });
  }
}

SEE ALSO#

indicator.plot.marker, indicator.entity.marker, types.EntityMarker, types.RuntimeMarkerSeries