/* Multiple-security indicator example */
/* Language: AFL + JScript */
/* Use in "Scan" only */
/* (C)2001 Tomasz Janeczko

/* the criterion to check */
values = rsi() < 30;

EnableScript("jscript");

days = day();
months = month();
years = year();

<%
days = AFL("days").toArray();
months = AFL("months").toArray();
years = AFL("years").toArray();
values = AFL("values").toArray();

// get the access to AmiBroker's application object
oAB = new ActiveXObject("Broker.Application");

// we add artificial "_composite" stock that we will use to store
// the cross-market statistics information
comp = oAB.Stocks.Add("_composite");

for( i = 0; i < days.length; i++ )
{
   qt = comp.Quotations.Add( years[ i ]  + "-" + months[ i ] + "-" + days[ i ] );

   if( values[ i ] == 1 ) qt.Volume += 1;
}

%>

buy = 0;


