Hi,
Hope someone can help with this simple problem.
I have a system which generates Buy and Sell signals, and have used 
Exrem to remove excess signals. I now want to run an exploration over 
all symbols in my database to select all those for which the last 
signal was a Buy. I realise I could use Explore over the last n days 
(n=50 say)to pick up buy signals but would prefer to run over all 
quotations and pick up the last Buy, regardless of how long ago that 
was.
I tried adding:-
bought = flip(buy, sell); which sets bought to 1 after the last buy if 
there is no subsequent sell.
Also used Addcolumn to display bought.
 However, testing on a single stock with various attempts to filter on 
the LastValue of bought didn't work, as the Explore output gave every 
value in the chosen stock. My attempts to use ValueWhen(bi = Barcount)
fared no better.
The problem (to me at least) seems to be that when you would like to 
set a single variable to a value, AFL makes it a complete array. The 
reason for this long-winded question is that I think this problem of 
getting single values rather than arrays arises all the time - so a 
general explanation of ways around it would be most helpful.
Thanks in anticipation

Brian W


Reply via email to