Amiquote automation script for "select failed" and "mark selection"

I have been using script to automate the Amiquote download process.

Recently, I just discovered that some of the symbols stop updating.

Annotation 2020-08-30 233123
Stopped around Apr 2020

Annotation 2020-08-30 233148
Annotation 2020-08-30 233327
And I found there were 265 symbols consistently failed to download in the list

Annotation 2020-08-30 233513
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.

Annotation 2020-08-30 233239
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
1 Like

10 simultaneous downloads will cause YAHOO BAN sooner or later. Don't overuse free services as they will be shut down and then there will be lament "where do I get my data from now". Cherish the fact that you have free data and use wisely.

1 Like

Thanks, I change back to the fail-safe default setting now.