Skip to main content

plot.marker#

Stamp a marker glyph at (currentBarIndex, value).

SYNTAX#

function plot.marker(label: string, value: number, opts?: { color?: string; shape?: 'circle' | 'square' | 'triangle' | 'triangle-down' | 'diamond' | 'cross' | 'x'; size?: number }): void

ARGUMENTS#

  • label (string) — Marker series identifier. Glyph (shape + size + color) is fixed per label by the first call.
  • value (number) — Y coordinate (price for overlay markers, sub-pane unit otherwise).
  • opts ({ color?: string; shape?: PlotMarkerShape; size?: number }) — Defaults: color #888, shape circle, size 5.

RETURNS#

void

REMARKS#

Markers are sparse, so omitting plot.marker on a bar simply leaves nothing rendered there. Different from lines, which interpolate gaps as breaks.

EXAMPLE#

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

SEE ALSO#

indicator.plot, indicator.plot.histogram, indicator.entity.marker, types.MarkerShape, ta.crossover