Donchian channel
Highest high and lowest low of the last N bars, with their midpoint.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| period | int | 20 | 1 to 5000 |
Outputs
| Name | Type | Required | Description |
|---|---|---|---|
| upper | value | Optional | color theme.accent, style line, width 1 |
| lower | value | Optional | color theme.accent, style line, width 1 |
| middle | value | Optional | color theme.accent, dash dash, style line, width 1 |
- Warm-up
- period - 1 bars (19 at the defaults)
- Repaints
- No
- Parity
- TA-Lib
Formula
upper = the highest high of the last period bars
lower = the lowest low of the last period bars
middle = (upper + lower) / 2