示例#1
0
        // 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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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();
            }
        }
示例#4
0
        // 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();
            }
        }