I use below script to import amiquote data and save amibroker's database.
But it can't save amibroker's database successfully.
I am using amibroker's version 6.002 now.
Is this issue fixed on newest amibroker?
Thank you very much.
AB = new ActiveXObject( "Broker.Application" ); // creates AmiBroker object
WScript.sleep(3000);
try
{
var database="E:/AmiBroker/AmiQuote/test1";
AB.LoadDatabase (database);
}
catch ( err )
{
WScript.echo( "Exception: " + err.message ); // display error that may occur
}
WScript.sleep(5000);
AQ = new ActiveXObject("AmiQuote.Document");
AQ.Open("E:/AmiBroker/AmiQuote/test.tls");
FromDate = new Date(2005,5,1,0,0,0);
/* year, month-1, day, hour, min, sec (required by JScript date constructor) */
//ToDate = new Date; // current time
ToDate = new Date(2006,5,1,0,0,0);
/* getVarDate is required to convert from JScript Date to OLE-automation date */
AQ.From = FromDate.getVarDate();
AQ.To = ToDate.getVarDate();
AQ.AutoImport = true; // import automatically
AQ.Source = 4; // Yahoo Historical
AQ.Download(); // starts download
// wait until download and import is finished
while( AQ.DownloadInProgress || AQ.ImportInProgress )
{
WScript.sleep(5000); // wait 5 seconds before querying status again
}
AB.Refreshall();
AB.SaveDatabase();
AB.Quit();