> 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/api-reference/lifecycle/on-hide.md).

# OnHide

Hide or remove custom visuals when the user turns the indicator off without deleting it.

## Signature

```typescript
OnHide(): void
```

## Parameters

None.

## Returns

`void`.

## Usage

1. Override when the indicator draws chart objects or maintains visibility-only state.
2. Hide or delete owned chart objects that must disappear immediately. `OnHide` cleanup is valid when `OnShow` or later `OnCalculate` calls can recreate those objects.
3. Keep only the state and external resources that must survive the next show. Final teardown still belongs in [OnDeinit](/fto-indicators-docs/api-reference/lifecycle/on-deinit.md).

FTO stops calling `OnCalculate` while the indicator is hidden.

## Example

```typescript
public override OnHide(): void {
    this.api.DeleteObjectsByPrefix(0, 'MyIndicator_', 0, true)
}
```

## Related API

* [Indicator lifecycle](/fto-indicators-docs/api-reference/lifecycle/indicator-lifecycle.md)
* [Chart-object cleanup](/fto-indicators-docs/api-reference/objects/creation-and-cleanup/chart-object-cleanup.md)
* [OnShow](/fto-indicators-docs/api-reference/lifecycle/on-show.md)
* [OnDeinit](/fto-indicators-docs/api-reference/lifecycle/on-deinit.md)
