Dear all
I hope that some one tell me what is wrong with the code below.
i need to get the number of stocks above there 20 MA.
WatchlistNumber=0;
function CountTickers( Listnum )
{
list = GetCategorySymbols( categoryWatchlist , listnum ) ;
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
w=0;
Count=IIf(Foreign(sym,"Close") >
MA(Foreign(sym,"Close"),20),w+1,w);
{
if( i == 0 ) i = 0;
else i = i ;
}
return Count;
}
totalissue=CountTickers( WatchlistNumber);
Plot( totalissue, _DEFAULT_NAME(),ParamColor("Up Color",
colorBlack ), ParamStyle( "Style", styleThick) );
printf("totalissue:" + totalissue );
thanks in advance
Waleed
-----------------------------------------------------------------------------------------------------------------------
Send big files for free. Simple steps. No registration.
Visit now http://www.nawelny.com