public void ImportFromCsv() { var importer = new CsvImporter("fb.csv", new CultureInfo("en-US")); var candles = importer.ImportAsync("FB").Result; Assert.AreEqual(candles.Count(), 1342); var firstIOhlcvData = candles.First(); Assert.AreEqual(firstIOhlcvData.DateTime, new DateTime(2012, 5, 18)); }
protected async Task <IEnumerable <Candle> > ImportCandlesAsync() { var csvImporter = new CsvImporter("fb.csv", new CultureInfo("en-US")); return(await csvImporter.ImportAsync("fb")); //var yahooImporter = new YahooFinanceImporter(); //var candles = await yahooImporter.ImportAsync("FB"); //File.WriteAllLines("fb.csv", candles.Select(c => $"{c.DateTime.ToString("d")},{c.Open},{c.High},{c.Low},{c.Close},{c.Volume}")); //return candles; }
protected async Task <IEnumerable <IOhlcv> > ImportIOhlcvDatasAsync(string fileName = "fb.csv") { // Last record: 09/18/2017 var csvImporter = new CsvImporter(fileName, CultureInfo.GetCultureInfo("en-US")); return(await csvImporter.ImportAsync(string.Empty)); //var yahooImporter = new YahooFinanceImporter(); //var candles = await yahooImporter.ImportAsync("FB"); //File.WriteAllLines("fb.csv", candles.Select(c => $"{c.DateTime.ToString("d")},{c.Open},{c.High},{c.Low},{c.Close},{c.Volume}")); //return candles; }
public Benchmark() { var config = new CsvImportConfiguration() { Culture = "en-US", Delimiter = ";", DateFormat = "yyyyMMdd HHmmss", HasHeaderRecord = false }; var importer = new CsvImporter("Data/EURUSD.csv", config); _data = importer.ImportAsync("EURUSD").Result.ToArray(); }
public void ImportFromCsvWithTime() { var config = new CsvImportConfiguration() { Culture = "en-US", Delimiter = ";", DateFormat = "yyyyMMdd HHmmss", HasHeaderRecord = false }; var importer = new CsvImporter("EURUSD.csv", config); var candles = importer.ImportAsync("EURUSD").Result; Assert.AreEqual(744, candles.Count); var firstIOhlcvData = candles.First(); Assert.AreEqual(new DateTime(2000, 5, 30, 17, 27, 00), firstIOhlcvData.DateTime); }
public Benchmark() { var config = new CsvImportConfiguration() { Culture = "en-US", Delimiter = ";", DateFormat = "yyyyMMdd HHmmss", HasHeaderRecord = false }; var importer = new CsvImporter("Data/EURUSD.csv", config); _data = importer.ImportAsync("EURUSD").Result.ToArray(); _tradeData = new ITickTrade[_n]; var d = DateTimeOffset.Now; for (int i = 0; i < _n; i++) { _tradeData[i] = new Trade(d.AddSeconds(i), 1, 1); } }
public async Task <IEnumerable <Candle> > ImportCandlesAsync() { var csvImporter = new CsvImporter("fb.csv", new CultureInfo("en-US")); return(await csvImporter.ImportAsync("fb")); }
public async Task <IEnumerable <IOhlcv> > ImportIOhlcvDatasAsync() { var csvImporter = new CsvImporter("fb.csv", CultureInfo.GetCultureInfo("en-US")); return(await csvImporter.ImportAsync("fb")); }
protected async Task <IEnumerable <IOhlcv> > ImportCCiIOhlcvDatasAsync() { var csvImporter = new CsvImporter("cci_test.csv", CultureInfo.GetCultureInfo("en-US")); return(await csvImporter.ImportAsync("cci_test")); }
protected async static Task <IEnumerable <IOhlcv> > importData(string file, string symbol) { var csvImport = new CsvImporter(file, CultureInfo.GetCultureInfo("en-US")); return(await csvImport.ImportAsync(symbol)); }
public async Task <IEnumerable <IOhlcv> > ImportIOhlcvDatasAsync(string script) { var csvImporter = new CsvImporter(@"Data/" + script + ".csv", CultureInfo.GetCultureInfo("en-US")); return(await csvImporter.ImportAsync(script)); }
protected async Task <IEnumerable <IOhlcv> > ImportCandlesAsync() { var csvImporter = new CsvImporter("fb.csv", CultureInfo.GetCultureInfo("en-US")); return(await csvImporter.ImportAsync("fb")); }