I have been using script to automate the Amiquote download process.
Recently, I just discovered that some of the symbols stop updating.
Stopped around Apr 2020
And I found there were 265 symbols consistently failed to download in the list
I tried to download them separately and it worked.
And I tried to select failed and download again after the list finished download, all the failed symbols could be successfully downloaded.
I suspected the problem is because I download too quickly from yahoo.
And I just changed the "number of simultaneous download" from 10 to 5, and the "initial delay between request" from 1000 to 2000. Hope it will work.
However, I think it would be safe if I can select failed and download again after the list finished download every time.
How to write the command for that?
Below is the script I currently using:
//Open new file
AQMainboard = new ActiveXObject("AmiQuote.Document");
AQMainboard.Open("C:\\Program Files\\AmiBroker\\AmiQuote\\HKMainboard.tls");
//Set time fame
var ToDate = new Date(); // current time
var FromDate = new Date(ToDate.getTime() - 1000*60*60*24*5); //5 days ago
AQMainboard.From = FromDate.getVarDate();
AQMainboard.To = ToDate.getVarDate();
AQMainboard.Source = 0; // Yahoo Historical
AQMainboard.Download(); // starts download
while( AQMainboard.DownloadInProgress || AQMainboard.ImportInProgress )
{
WScript.sleep(5000); // wait 5 seconds before querying status again
}