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, | |
| |
| |
|
Unique to indicators
Page | Covers |
|---|---|
| |
histogram, area, baseline, fill, markers, priceLine, bandTemplate | |
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).
