indicator#
Indicator runtime hooks. onBar(i, ctx) is the main entry point, called once per candle. getSettings() is optional and declares user-configurable settings. compute() is the legacy entry point.
Functions#
indicator.compute— Legacy entry point for custom indicators.entity.arrow— Create or update a keyed arrow from(x1, y1)to(x2, y2)in data coordinates.entity.box— Create or update a keyed rectangular box in data coordinates.entity.label— Create or update a keyed text label at a data coordinate.entity.line— Create or update a keyed line entity in data coordinates (timestamp + price).entity.marker— Create or update a keyed marker at a data coordinate.indicator.getSettings— Optional function that declares user-configurable parameters for the indicator.indicator.onBar— Per-bar entry point for custom indicators (modern model).indicator.plot— Emit a single line value at the current bar insideonBar.plot.candle— Emit one OHLC tuple at the current bar to render an overlay candle.plot.histogram— Emit a histogram bar at the current bar index.plot.marker— Stamp a marker glyph at(currentBarIndex, value).