reference

Overview

Indicators are scripts that draw on Terminal charts — moving averages, oscillators, custom overlays — the series you look at while trading or researching.

Common pieces (bars, inputs, drawings, deps, MTF) are in Shared runtime. This section is only what indicators add: overlay vs pane, series types like histograms, and how onBar wires those pieces together.

Covered in Shared runtime

Topic

Page

Bar fields, accum, inputs/layout

Shared runtime

ctx.plot / mark / hline / range

Drawing on the chart

indicators.declare

Declaring indicator dependencies

security / tf / runOn

Multi-timeframe and runOn

Unique to indicators

Page

Covers

Overlay vs pane

kind overlay or pane, pane(), shortName

Indicator series types

histogram, area, baseline, fill, markers, priceLine, bandTemplate

Indicator onBar

Indicator entry + wiring shared APIs

Minimal shape

meta({ shortName: "EMA", kind: "overlay" });
dialog({ title: "EMA" });
const length = input.number({ id: "length", label: "Length", default: 20, min: 1 });
output.line({ id: "ema", color: "#2196f3" });
layout(tab({ id: "main", title: "Main" }, section({ id: "p", title: "Parameters" }, length)));

function onBar(ctx) {
  const k = 2 / (ctx.params.length + 1);
  const ema = ctx.accum("ema", null, (prev) =>
    prev == null ? ctx.close : prev + k * (ctx.close - prev)
  );
  ctx.plot("ema", ema);
}

Author in Research → Indicators (Code tab or indicator authoring agent).

Next

  1. Shared runtime

  2. Indicator series types

  3. First indicator guide