Skip to main content

entity.arrow#

Create or update a keyed arrow from (x1, y1) to (x2, y2) in data coordinates.

SYNTAX#

function entity.arrow(props: { key: string; x1: number; y1: number; x2: number; y2: number; color: string; width?: number; forceOverlay?: boolean }): EntityHandle

ARGUMENTS#

  • props ({ key, x1, y1, x2, y2, color, width?, forceOverlay? }) — Tail at (x1, y1), head at (x2, y2). Coordinates are unix-second timestamps and prices.

RETURNS#

EntityHandle — { set(props), delete() }.

REMARKS#

Arrow rendering ships in Round 2 Track F; entities are accepted by the runtime but render as no-ops until then.

EXAMPLE#

function onBar(i, ctx) {
  if (i < 5 || !ctx.isLast) return;
  entity.arrow({
    key: 'breakout',
    x1: candles[i-5].time, y1: candles[i-5].low,
    x2: candles[i].time,    y2: candles[i].high,
    color: '#26a69a', width: 2
  });
}

SEE ALSO#

indicator.entity.line, indicator.entity.marker, types.EntityHandle