# Keltner channel

`kc`

An EMA with bands set by the average true range.

## Inputs

| Name | Type | Default | Range |
| --- | --- | --- | --- |
| ema_period | int | 20 | 1 to 5000 |
| atr_period | int | 10 | 1 to 5000 |
| atr_factor | float | 2 | 0 to 10 |

## Outputs

| Name | Kind |
| --- | --- |
| upper | value |
| middle | value |
| lower | value |

Warm-up: max(ema_period - 1, atr_period) bars (19 at the defaults).

Repaints: No.

## Formula

middle = the EMA of the closes over ema_period

upper = middle + atr_factor * ATR, lower = middle - atr_factor * ATR

ATR is the simple average of the true range over atr_period, as the MetaTrader 5 Keltner Channel computes it.
