Category
Multi-Bar Functions
Description
Count of bars since a condition was last true
Syntax
SinceTrue(condition, count {0})
Parameters
condition - data series formula
count - lookback period (optional)
Notes
Condition will be evaluated for the most recent bar first, then proceed back in time until a non-zero value is found or count bars have been checked, whichever comes first.
For each bar, condition is evaluated as if that bar were the current bar, i.e. without knowledge of future splits relative to that bar.
If count is omitted then there is no maximum (all bars before this one are potentially checked).
If condition was never true, the return value is -1.
If condition is currently true, the return value is 0.
If condition was most recently true yesterday, the return value is 1, and so on.
This function supports ultra-fast one-pass calculation when used in the Data Section without a count argument.
|