CountIf()
<< Click to Display Table of Contents >> CountIf() |
Counts the number of instances the test condition occurs over the look-back period expressed in bars.
Note: This method does NOT work on multi-series strategies and indicators. |
An int value representing the number of occurrences found
CountIf(Func<bool> condition, int period)
condition |
A true/false expression |
period |
Number of bars to check for the test condition |
Tip: The syntax for the "condition" parameter uses lambda expression syntax |
// If in the last 10 bars we have had 8 up bars then go long |