public void ProcessSymbol(int total, SymbolData symData, IEXData.HistoryType ht) { Trading.Company c = Trading.IEXData.DownloadSymbol(symData.symbol, ht, symData); if (c.Id != -1) { this.AddSymbol(c); } current++; int left = total - current; double avgSec = sw.Elapsed.TotalSeconds / current; TimeSpan ts = new TimeSpan(0, 0, (int)(avgSec * left)); Debug.Nlog(current.ToString() + "/" + total.ToString() + "\t" + symData.symbol + ", " + ts.ToString() + " left"); }
public void GetAllData(IEXData.HistoryType ht, int num) { List <Trading.SymbolData> symbols = Trading.IEXData.DownloadSymbolList(); int cnt = symbols.Count; if (num > 0) { cnt = num; } current = 0; for (int i = 0; i < cnt; i++) { Trading.SymbolData symData = symbols[i]; Debug.Nlog((i + 1).ToString() + "/" + symbols.Count.ToString() + "\t" + symData.symbol); Trading.Company c = Trading.IEXData.DownloadSymbol(symData.symbol, ht); if (c.Id != -1) { this.AddSymbol(c); } } }