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

Re: [amibroker] Re: Help in AFL



PureBytes Links

Trading Reference Links

Thanks Joe .

Bernard

Joe Landry a écrit :
 
Good point Johan..the moving average function probably doesn't like empty arrays.
Thanks for pointing this out.
 
Bernard - I experience the same effect with DebugView.  The only thing I know is Amibroker
runs through the routine twice, so that why we get 2 traces.  If I remember correctly AB
goes through the AFL and arrays 1) once to calculate the buys and sells and 2) then
runs through a second time to account for the trades,
 
Best regards
JOE
 
----- Original Message -----
Sent: Tuesday, July 05, 2005 1:00 PM
Subject: Re: [amibroker] Re: Help in AFL

Thanks Johan

johsun a écrit :
--- In amibroker@xxxxxxxxxxxxxxx, "johsun" <joh.sun@xxxx> wrote:
> 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);
> }



And the moving average too for that matter...



> 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




-- 
Bernard Bourée
bernard@xxxxxxxxxx
Mob: +33 6 09 11 05 91 


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





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




-- 
Bernard Bourée
bernard@xxxxxxxxxx
Mob: +33 6 09 11 05 91 


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