talib.barssince

Counts the bars that have gone by since condition was last true. The condition slot is wide: an int, a float or a bool expression is accepted.

talib.barssince(series bool condition) → series int
ParameterTypeRequiredDescription
conditionseries boolyesThe test to look back for. Int, float and bool expressions are all accepted.

Returns series int — A series int bar count.

indicator("Bars since the last up bar")
plot(talib.barssince(close > open))

See also talib.alma · talib.atr · talib.bb

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