Indicator structure

import { IndicatorImplementation } from "forex-tester-custom-indicator-api";

export default class IndicatorName extends IndicatorImplementation {
  // parameters

  public Init(): void {
    // initialization logic
  }

  public Calculate(index: number): void {
    // calculation logic
  }

  public OnParamsChange(): void {
    // logic after parameters change
  }

  public Done(): void {
    // logic after finishing the calculation
  }

  public OnHide(): void {
    // logic after hiding the indicator
  }

  public OnShow(): void {
    // logic after showing the indicator
  }
}

Description of the structure

Main methods of each indicator are Init and Calculate, Init is called once when the indicator is created, and Calculate is called on each tick. Other methods are optional and can be used to add additional logic to the indicator.

To get familiar with other methods, you can read the documentation for each method.

Last updated