# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fto-2.gitbook.io/fto-indicators-docs/indicators/indicator-structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
