private string DownloadURL(IEnumerable <string> ids, System.DateTime fromDate, System.DateTime toDate, HistQuotesInterval interval)
 {
     string[] idArr = MyHelper.EnumToArray(ids);
     if (idArr.Length == 0)
     {
         throw new ArgumentNullException("unmanagedIDs", "The passed list is empty");
     }
     else
     {
         if (idArr.Length == 1)
         {
             if (idArr[0].Trim() == string.Empty)
             {
                 throw new ArgumentNullException("id", "The passed ID is empty.");
             }
             else
             {
                 System.Text.StringBuilder url = new System.Text.StringBuilder();
                 url.Append("http://ichart.yahoo.com/table.csv?s=");
                 url.Append(Uri.EscapeDataString(MyHelper.CleanYqlParam(FinanceHelper.CleanIndexID(idArr[0]).ToUpper())));
                 url.Append("&a=");
                 url.Append(fromDate.Month - 1);
                 url.Append("&b=");
                 url.Append(fromDate.Day);
                 url.Append("&c=");
                 url.Append(fromDate.Year);
                 url.Append("&d=");
                 url.Append(toDate.Month - 1);
                 url.Append("&e=");
                 url.Append(toDate.Day);
                 url.Append("&f=");
                 url.Append(toDate.Year);
                 url.Append("&g=");
                 url.Append(FinanceHelper.GetHistQuotesInterval(interval));
                 url.Append("&ignore=.csv");
                 return(url.ToString());
             }
         }
         else
         {
             System.Text.StringBuilder url = new System.Text.StringBuilder();
             url.Append("url in (");
             for (int i = 0; i <= idArr.Length - 1; i++)
             {
                 url.Append('\'');
                 url.Append(this.DownloadURL(new string[] { MyHelper.CleanYqlParam(FinanceHelper.CleanIndexID(idArr[i]).ToUpper()) }, fromDate, toDate, interval));
                 url.Append('\'');
                 if (i < idArr.Length - 1)
                 {
                     url.Append(',');
                 }
             }
             url.Append(")");
             return(MyHelper.YqlUrl("*", "csv", url.ToString(), null, true));
         }
     }
 }