> For the complete documentation index, see [llms.txt](https://fto-2.gitbook.io/fto-indicators-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fto-2.gitbook.io/fto-indicators-docs/indicators/indicator-structure.md).

# Indicator structure

```typescript
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](/fto-indicators-docs/indicators/indicator-structure/init.md) and [Calculate](/fto-indicators-docs/indicators/indicator-structure/calculate.md),\
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.

* [OnParamsChange](/fto-indicators-docs/indicators/indicator-structure/on-params-change.md)
* [Done](/fto-indicators-docs/indicators/indicator-structure/done.md)
* [OnHide](/fto-indicators-docs/indicators/indicator-structure/on-hide.md)
* [OnShow](/fto-indicators-docs/indicators/indicator-structure/on-show.md)
