Are you using live data or static data? 

If you are using a live data feed intraday and you want to count the 
number of times you get a signal you will probably have to store the 
count in static variables. The reason is that the signals may occur 
many times in a bar and disappear before the bar closes. From AFLs 
point of view those signals never happened. But an auto trading program 
will see them and act on them. 

The reason they appear and disappear is that AB scans through your 
indicators every time a tick comes in. If the condition is true on one 
scan it may not be true on the next scan. The condition may be true for 
many ticks and reverse if the condition no longer exists by the end of 
the bar. 

As a side point, this is one reason it is almost impossible to back 
test live trading programs and get reliable results.

If you are using static or live data one way to accomplish this is to 
give each signal a weighing factor and buy if the sum exceeds a 
threshold. The problem with a weighting factor with live data is that 
you may get many more signals than you expect which would throw the 
count off.

With static only data you can test n bars for a condition and set the 
signal true if it occurs over that period. Then sum all true conditions 
and buy if that is over a threshold.

Barry

--- In [email protected], "shaunpms" <shaun...@...> wrote:
>
> Hello all - Is there an easy way to code the trading algorithm such 
> that some number of multiple signals must cross a threshold before 
the 
> real Buy signal is evoked?  E.g. suppose you have 8 signals, and when 
> any 5 of the 8 signals are True - you do the actual Buy.  Its almost 
> like I'm looking for the sum of each signal to be compared to a 
> threshold before Buying.  I thought I could do this by going thru 
each 
> bar and creating a side stepped array which is the aggregate of all 
> other signals, but wondered if someone had a shorter way to do this.
> 
> thanks in advance,
> shaun
>


Reply via email to