← Back to Library
Momentum

CCI (Commodity Channel Index)

CCI is a momentum-based oscillator used to help determine when an investment vehicle is reaching a condition of being overbought or oversold.

Pine Script V6
//@version=6
indicator('CCI', overlay=false)
len = input.int(20, 'Length')
src = input.source(hlc3, 'Source')
plot(ta.cci(src, len), 'CCI', color=color.turquoise)