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

[amibroker] AB.RefreshAll()



PureBytes Links

Trading Reference Links

Hi Guys,

I'm using a script to update all symbol info(downloaded from the
newsletter ). but nothing happened. 
so I restart my amibroker program, still the same.
only after I exit another brokor.exe thread in window's task list,
then I get the updated result. ( I can see it's saving database right
before it exits completely.)
Is the script creating a new broker instance everytime I ran it? if
so, it doesn't make sense to even call refreshAll()...what am I
missing here? 

Thank you.
Eric

//here's the code I downloaded ///////////////

var filename = "industryData.txt";

var fso, f, r;
var ForReading = 1;
var AmiBroker;
var fields;
var stock;
/* Create AmiBroker app object */
AmiBroker = new ActiveXObject( "Broker.Application" );

/* ... and file system object */
fso = new ActiveXObject( "Scripting.FileSystemObject" );
/* open ASCII file */
f = fso.OpenTextFile( filename, ForReading);
/* read the file line by line */
while ( !f.AtEndOfStream ){
      r = f.ReadLine();
      /* split the lines using comma as a separator */
      fields = r.split(",");
      /* add a ticker - this is safe operation, in case that */
      /* ticker already exists, AmiBroker returns existing one */
      stock = AmiBroker.Stocks.Add( fields[ 0 ] );
      stock.FullName = fields[ 1 ];
      stock.IndustryID = parseInt( fields[ 2 ] );
}
/* refresh ticker list and windows */
AmiBroker.RefreshAll();

// end //////////




Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.34/679 - Release Date: 2/10/2007 4:08 PM