> 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/done.md).

# Done

### What is it?

The `Done` method is called **once**, after the indicator has finished calculating all bars.\
It marks the end of the calculation cycle and is typically used for **final steps or cleanup**.

***

### Syntax

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

***

### When and Why to Use It

Use `Done` when you need to:

* Perform **post-processing** after all `Calculate()` calls are complete
* Draw or update **custom chart objects** that rely on full data
* Clean up temporary data or buffers
* Log or store final values

This method is especially useful if your indicator logic depends on seeing the **entire dataset**.

***

### Example

```ts
public Done(): void {
    // Draw a horizontal line based on final SMA value
    const lastIndex = 0
    const finalValue = this.SMA.getValue(lastIndex)
    
    // custom method CreateHorizontalLine
    this.api.CreateHorizontalLine("FinalSMA", finalValue, "red") 
}
```

***

### Important Notes

* `Done` is called **after all bars** have been processed in `Calculate()`.
* It runs **once** per full calculation cycle — not on every tick.
* It’s safe to use this method to add chart decorations, logs, or summary calculations.
