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

[amibroker] Help with Jscript code... (for-loop)



PureBytes Links

Trading Reference Links

Hi group,

I want to cycle thru all stocks that present buy signals in my AFL 
scan and run a Jscript code against them, but the code I assemble 
below runs thru all stocks in my database.  How to I cycle thru just 
the stocks that presented buy signal in my alf scan?   Thank you.  
P.S.  I'm not a professional coder expert! ;-}

< AFL SCAN LOGIC GOES HERE.......>

EnableScript("jscript");
<%
BuyStk = VBArray( AFL("BUY") ).toArray();
function GetArray( Name )
{
return VBArray( AFL( Name ) ).toArray();
}

var oAB = new ActiveXObject("Broker.Application"); 
var fso = new ActiveXObject("Scripting.FileSystemObject"); 
file = fso.OpenTextFile( "exporting_list.txt", 2 ); 

var oStocks = oAB.stocks; 
var Qty = oStocks.Count;

for( i = 0; i < Qty; i++ ) 
{			
		if ( (BuyStk[i]) == 1)
		{
		  oStock = oStocks( i );
		 file.writeLine( oStock.Ticker + "," + 
oStock.Fullname);
		}	
} 

file.Close(); 
%>




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/