Navigation: Realtest Script Language > Syntax Element Details >

CountTrue

 

 

 

 

Category

Multi-Bar Functions

Description

Count of bars for which a condition was true (non-zero)

Syntax

CountTrue(condition, count {0})

Parameters

condition - data series formula

count - lookback period (optional)

Notes

Condition will always be evaluated for count bars (or all bars if omitted).

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 condition was never true for any bar, the return value is 0.

Unless you really care about the specific count, it is more efficient to use SinceTrue to test whether a condition has ever been true.

This function supports ultra-fast one-pass calculation when used in the Data Section without a count argument.

 

 

 

Copyright © 2020-2022 Systematic Solutions, LLC