Count of Signals

#1
Need real help from AmiBroker Experts.
How to count the number of times a condition was true in say last 14 bars?
Is it possible to get such a count? Experts please help and guide.
 
#3
Thanks a lot, R. I will try it out today.
---------
The function reference of "Cum" says that to find count of condition when true for a range of bars, "Sum" should be used
- example -
count = LastValue(Sum(C>O , 14));
this should give the number of times C was greater than O in last 14 bars.
What do you think?
 
Last edited:

Romeo1998

Well-Known Member
#7
ok, i had a look at the help file :D

Cum( ARRAY )
Cum( Value )

Calculates a cumulative sum of the ARRAY from the first period in the chart.

Sum( ARRAY, periods )
Calculates a cumulative sum of the ARRAY for the specified number of lookback periods (including today).

:D ur code is correct :D
:D using sum is correct bcoz u want to count the condition for a range of bars n not all bars :D