arrowMarker

The arrowMarker method places a simple arrow marker at a chosen bar and price. It’s lighter than the full arrow tool and perfect for tagging signals (entries, exits) or just leaving a quick marker with optional text.

Syntax (one line)

arrowMarker(time, price, styles?, text?)

Parameters

time (number) · Candle time where the marker is placed (e.g., time(0) for the current bar). price (number) · Price level where the arrow marker points (e.g., closeC(0)). styles (ArrowMarkerLineToolOverrides) · Visual and label options for the marker:

  • backgroundColor (RGBAColor | BaseColors) · Fill color for the marker background.

  • bold (boolean) · Make label text bold.

  • fontsize (number) · Label font size.

  • italic (boolean) · Italicize the label text.

  • showLabel (boolean) · Show/hide a text label next to the marker.

  • textColor (RGBAColor | BaseColors) · Color of the label text. text (string) · Optional short label (e.g., "Entry", "Exit").

Return Value

(string) · The drawing ID of the created arrow marker.

Example

What this does: Every 60 candles, it drops a lightweight arrow marker at the current close, with a small label.

//@version=1
init = () => {
  indicator({ onMainPanel: true, format: 'inherit' });
};

onTick = () => {
  if (index % 60 === 0) { // draw occasionally for clarity
    // 1) Style (ArrowMarkerLineToolOverrides)
    const style = {
      backgroundColor: color.rgba(0, 200, 0, 0.2),
      textColor: color.white,
      fontsize: 12,
      bold: true,
      italic: false,
      showLabel: true
    };

    // 2) Place the arrow marker
    arrowMarker(time(0), closeC(0), style, "Entry");
  }
};

Tips

  • Best used when you just want a lightweight marker without extra stats or ranges.

  • Keep label text short and direct so the chart stays clean.

Warning

  • Too many markers close together can overlap—space them out or hide labels (showLabel: false).

Good Practice

  • Use consistent presets (e.g., green markers for buys, red markers for sells) so you can instantly recognize signals.

Last updated