API REFERENCE

IndicatorDefinition

The IndicatorDefinition type declaration and related types. Optional fields are marked with ?.

Type declaration

typescript
export interface IndicatorDefinition {
  readonly kind: string;
  readonly label: string;
  readonly placement: IndicatorPlacement;
  readonly defaults: Readonly<Record<string, number>>;
  readonly outputs: ReadonlyArray<IndicatorOutputSpec>;
  readonly bands?: ReadonlyArray<IndicatorBandSpec>;
  readonly compute: (bars: ReadonlyArray<StockBar>, params: Record<string, number>) => IndicatorColumns;
  readonly guides?: ReadonlyArray<number>;
  readonly guideBand?: readonly [number, number];
  readonly computeLevels?: (
    bars: ReadonlyArray<StockBar>,
    from: number,
    to: number,
    params: Record<string, number>,
  ) => IndicatorLevel[];
}