// where code like "CME_MGC1" static async Task DownloadQuandlContinuousFutures(string quandlApiKey, string code) { var qdl = new Quandl(quandlApiKey); var csv = await qdl.RequestWikiContinuousFuturesCsv(code); var filepath = Path.Join(rootDataPath, "Quandl", "ContinuousFutures", code + ".csv"); await csv.SaveFile(filepath); }
static async Task DemoQuandl(string quandlApiKey) { var qdl = new Quandl(quandlApiKey); //var csv = await qdl.RequestWikiStockCsv("GOOG"); var csv = await qdl.RequestWikiContinuousFuturesCsv("CME_MGC1"); Console.WriteLine(csv.Headers); foreach (var l in csv.Lines.Take(25)) { Console.WriteLine(l); } }
static async Task DownloadQuandlDatabases(string quandlApiKey) { var filepath = Path.Join(rootDataPath, "Quandl", "databases.txt"); var qdl = new Quandl(quandlApiKey); var databases = await qdl.GetAllDatabases(); using (var f = new StreamWriter(filepath)) { await f.WriteAsync(databases); f.Flush(); } }
// where db like "WIKI" static async Task DownloadQuandlCodes(string quandlApiKey, string db) { var filepath = Path.Join(rootDataPath, "Quandl", "Codes", $"{db}.txt"); var qdl = new Quandl(quandlApiKey); var codes = await qdl.GetCodes(db); using (var f = new StreamWriter(filepath)) { await f.WriteAsync(codes); f.Flush(); } }