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

RE: [amibroker] Javascript help plz



PureBytes Links

Trading Reference Links

Don't know if you found an answer yet. I am no expert but maybe it is the
way the txt file is referenced. You may need to add the path to it. eg
"C:\\amibroker\\file\\beat.txt"


Cheers,
Graham
http://groups.msn.com/ASXShareTrading
http://groups.msn.com/FMSAustralia

-----Original Message-----
From: nkis22 [mailto:nkishor@xxxxxxxxxx] 
Sent: Wednesday, 7 May 2003 1:26 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Javascript help plz


I am using this script below to assign a list of tickers
to watchlist, but I get an error saying "file not found"

The script and the named file are both in the same directory
and AB is up an running. THe "beat.txt" is acii

Please help or tell me another way I can put a list into
a watchlist.

thanks in advance
nand


//======================================================
var filename;
var fso, f, r;
var ForReading = 1;
var AmiBroker;
var fields;
var stocks;
AmiBroker= new ActiveXObject("Broker.Application");
fso= new ActiveXObject("Scripting.FileSystemObject");
 
filename="beat.txt";
f = fso.OpenTextFile(filename, ForReading);
while(!f.AtEndOfStream)
{
r=f.ReadLine();
fields=r.split(";");
stock=AmiBroker.Stocks.Add(fields[0]);
stock.WatchListBits = stock.WatchListBits | ( 1 << 0 ); 
}
AmiBroker.RefreshAll();
//end =============



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/ 


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/BVVfoB/hP.FAA/uetFAA/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/