talib.cog

Centre of gravity of source across a window of length bars.

talib.cog(series float source, series int length) → series float
ParameterTypeRequiredDescription
sourceseries floatyesThe series to measure.
lengthseries intyesHow many bars the window covers.

Returns series float — A series float.

indicator("Centre of gravity")
plot(talib.cog(close, 10))

See also talib.alma · talib.atr · talib.barssince

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade