Amibroker AFL coding help required

Whenever I press Explore button, I want this afl to explore and display only 1 symbol having smallest value of ROC(C,10), in Automatic Analysis window out of watch-list. But something is missing here, please help me.. 

wlnum = GetOption( "FilterIncludeWatchlist" ); 
List = CategoryGetSymbols( categoryWatchlist, wlnum ) ; 

if ( Status("stocknum") == 0 )

    StaticVarRemove( "values*" ); 
    StaticVarRemove( "rank*" ); 

    for ( n = 0; ( symbol = StrExtract( List, n ) )  != "";  n++ ) 
    { 
        SetForeign ( symbol ); 
        values = ROC(Close, 10);
        RestorePriceArrays(); 
        StaticVarSet ( "values" + "_" + symbol, values ); 
    } 

    StaticVarGenerateRanks( "values", "values" + "_", -3, 1234 );

symbol = Name(); 

values = StaticVarGet( "values" + "_" + symbol );
bot = StaticVarGet( "bot" + "values" + "_" + symbol );

AddColumn ( bot, "rank" );
AddColumn ( values, "values" );

Filter = bot <= 10;

..................

with the above AFL for me showing no results, please check if you have missed buy and sell signals or specify your condition in brief

b=Cross(EMA(C,14),EMA(C,41));
s=Cross(EMA(C,41),EMA(C,14));
Fixed quantity of 50 for buy, sell, short, cover. What would be the role of following lines of code, if applied as well;
Buy=Ref(b,-1);
Sell=Ref(s,-1);
Anyone with answer…

Has anyone got the answer yet… this could be helpful to lots of people…