Have a look at the Sum function.

e.g.
Count = Sum(Price > 10, 20);
Plot(Count, ...);

Mike

--- In [email protected], "rise_t575" <tare...@...> wrote:
>
> Hallo,
> 
> I'm brandnew to Amibroker and AFL (and the last time I've been coding was in 
> my childhood) and trying my first steps here.
> 
> Could someone give me at least a pointer how I could code the following 
> scenario:
> 
> A graph that counts the number of times a condition is met in a trailing 
> "time window".
> 
> Example:
> For every bar, the following is calculated:
> How many times within the last 20 bars has the condition (like price > 10) 
> been met?
> 
> Any help is appreciated!
> 
> Thanks in advance.
>


Reply via email to