Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.darvas.app/llms.txt

Use this file to discover all available pages before exploring further.

Signature

Marker(key, opts) -> handle
A Marker is a persistent keyed icon entity. It differs from plot(..., { style: "circles" }) - plot circles are per-bar time-series values; a Marker is a static annotation that you explicitly create and manage.

Quick example

const buyMarker = Marker("buy-signal", {
  x: 10, y: 42000,
  shape: "triangle_up",
  size: 10.0,
  color: "#22c55eFF",
});

Options

x
number
required
X coordinate as a bar index.
y
number
required
Y coordinate as a price level.
shape
string
required
Icon shape. One of: "circle", "square", "triangle_up", "triangle_down", "diamond", "cross", "x", "arrow_up", "arrow_down".
size
number
Size in pixels. Default: 8.0.
color
string
Marker color as #RRGGBBAA.
zIndex
number
Stacking order. Default: 0.
forceOverlay
boolean
Render in main price pane from a sub-pane indicator. Default: false.

Shape enum values

ValueAppearance
"circle"Filled circle
"square"Filled square
"triangle_up"Triangle pointing up
"triangle_down"Triangle pointing down
"diamond"Diamond / rhombus
"cross"Plus sign (+)
"x"X shape
"arrow_up"Arrow pointing up
"arrow_down"Arrow pointing down
You can also use shape.* constants:
Marker("sig", { ..., shape: shape.diamond });

Handle methods

marker.set({ shape: "triangle_up", color: "#22c55eFF" });
marker.clone("buy-signal-2");
marker.delete();

Marker vs plot circles

Marker (persistent entity) and plot(..., { style: "circles" }) (per-bar time-series) look similar but behave differently. Use Marker for manual annotations anchored to a specific historical bar. Use plot circles when you want a computed value at every bar evaluated by onBar.

Signal annotation example

onBar(() => {
  const rsi = ta.rsi(ctx.close, 14);
  if (na(rsi)) return;

  if (ta.crossunder(ta.rsi(ctx.close, 14), 30)) {
    // RSI crossed below 30 - bullish oversold signal
    Marker(`os_${ctx.i()}`, {
      x: ctx.i(),
      y: ctx.low() * 0.998,
      shape: "arrow_up",
      size: 12,
      color: "#22c55eFF",
    });
  }
});

Label

Text annotations at a point.

Plot styles

circles and arrowup/arrowdown plot styles for per-bar markers.

Constants

shape.* enum values.