Esempio n. 1
0
        static async Task DemoBinanceCandlestickToCsv(string binanceApiKey, string symbol = "BTCUSDT")
        {
            var exch = new Binance(binanceApiKey);

            var path = Path.Join(rootDataPath, "Binance");

            Binance.CandlestickList klines;
            klines = await exch.Klines(symbol);  // default is "1m"

            await klines.OutputToCsv(path);

            klines = await exch.Klines(symbol, "3m");

            await klines.OutputToCsv(path);

            klines = await exch.Klines(symbol, "5m");

            await klines.OutputToCsv(path);

            klines = await exch.Klines(symbol, "15m");

            await klines.OutputToCsv(path);

            klines = await exch.Klines(symbol, "30m");

            await klines.OutputToCsv(path);

            klines = await exch.Klines(symbol, "1h");

            await klines.OutputToCsv(path);

            klines = await exch.Klines(symbol, "12h");

            await klines.OutputToCsv(path);

            klines = await exch.Klines(symbol, "1d");

            await klines.OutputToCsv(path);
        }