[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Help in AFL



PureBytes Links

Trading Reference Links

Bernard,

Joe has a point about what happens if there is an empty value.
Your code will be better if you use Nz() on the f variable.

Liste = CategoryGetSymbols( categoryWatchlist, 0 );
for( i = nb = 0; ( Sym = StrExtract( Liste, i ) ) != ""; i++ )
{
f = Nz( Foreign( Sym, "C" ) );
MMA = MA(f, 70);
nb = nb + (f> MMA);
}

Johan






--- In amibroker@xxxxxxxxxxxxxxx, Bernard Bourée <bernard@xxxx> 
wrote:
> 

Joe

Thanks for your help.
In fact there was an other error.
I was trying to find how many stocks on each bar had thei MA higher 
than their close.
So I have to declare  Nb as an array and increase by one each loop 
when the test is true.
With this modification it's works.

Thanks for your help.

Bernard




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/