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

[amibroker] AFL Error



PureBytes Links

Trading Reference Links

I have the following Indicator which call an include file.
When checking the syntax in the Fonctions.afl, I get no error.
When I check it on my indicator I get the following error:
Line 1, Col:659:Error 8
Error 8. Type mismatch, the value assigned to the array element has to 
be a number. You can not use array on the right-side of this assignment.

Can someone help me to find where the error is ?
========================
#include <Fonctions.afl>
periods = Param("Periods", 20, 1, 200, 1 );
WL=Param("WatchList number",0,0,63,1);
Indice=ParamStr("Ticker","^FCHI");
Plot( MatriceMMA(WL,Indice, periods), _DEFAULT_NAME(), ParamColor( 
"Color", colorCycle ), ParamStyle("Style")  );
============================
The file Fonctions.afl contains the following function
function MatriceMMA( ListNum, Index, Duree )
{
    Liste = CategoryGetSymbols( categoryWatchlist, ListNum );
   MMA[0] = 0; // just in case there are no watch list members
    Nb=0;
    for( i = 0; ( Sym = StrExtract( Liste, i ) ) != ""; i++ )
   {
          f = Foreign( Sym, "C" );
         MMA[i] = MA(f,Duree);
        if (f>MMA[i]) nb=nb+1;
    }
    f = Foreign( Index, "C" );
    MMAInd=MA(F,Duree);
    if(f>MMAInd) nb=nb+1;
   
   return nb/(i+1)*100; 
   
}



-- 
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

<*> 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/