cci
Commodity Channel Index
Reference/Oscillators/Function
cci(source, length)
Typical-price deviation from its SMA. Often ±100 as bands. Default 20. Short form `cci(20)` uses close.
Parameters
| Name | Type | Description |
|---|---|---|
sourceoptional | series default close | Series to use. Omit it when the first argument is a number — ema(9) means ema(close, 9). |
length | int default 20 | Lookback in bars. Default 20. |
Return value
series
Short form: if the first argument is a number, Dovee uses close as the source.
Example
oscillator c = cci(20) plot c as "CCI" level 100 as "OB" red level -100 as "OS" green when c crosses above -100 then buy