Definition
Counts the number of occurrences of the test condition over the look back period expressed in bars. This method will NOT work on multi-series strategies.
Method Return Value
An int value representing the number of occurrences found
Syntax
CountIf(Condition condition, int period)
The syntax for condition must be written in the following manner:
delegate { return your true/false condition;}
Parameters
condition
|
A true/false expression
|
period
|
Number of bars to check for the test condition
|
Examples
if (CountIf(delegate {return Close[0] > Open[0];}, 10) > 8)
EnterLong();
|
|
|