Sometimes you need to know the number of times which a specific condition happens. For
example, you want to know the number of crosses of two moving averages or the number of
bullish candles or number of candles in which MACD signal is above MACD mainline or
number of seconds or whatever. In these cases, you can use a counter.
Counter needs four parameters which are like below:
Condition, Step, Reset, Start
Only the first one is required and rest of them are optional.
In the counter, you need to set a certain expression’s which only if a certain condition is true, a
counter adds it to its value. If the Reset expression gets true, it will reset the counter to the Start
value. For example:
MA1 Crossup MA2, 2, Hour=23, 1
This means every time MA1 crosses up MA2, counter will be added by 2. Counter will do this
until 23:00 o’clock and after that counter will reset to 1 again.
[Counter] Counter Condition, Step, Reset, Start
Start is a number and rest are expressions
Default step: 1
default Start: 0