public static void ImportTicksTransaction(string[] args) { Console.WriteLine(""); Console.WriteLine(String.Format("TimeStart: {0}", System.DateTime.Now)); System.DateTime TimeStart = System.DateTime.Now; if (args.Count() > 0) { foreach (var item in args) { Console.WriteLine(String.Format("Read: {0}", item.ToString())); ITransaction tickImportTransaction = new ImportTicksTransaction(TradingData.Instance.Get <ObservableCollection <Tick> >(), item); tickImportTransaction.Execute(); } } else { Console.WriteLine(String.Format("Read: {0}", fileNameDefault.ToString())); ITransaction tickImportTransaction = new ImportTicksTransaction(TradingData.Instance.Get <ObservableCollection <Tick> >(), fileNameDefault); tickImportTransaction.Execute(); } Console.WriteLine(String.Format("TimeFinish: {0}", System.DateTime.Now)); System.DateTime TimeFinish = System.DateTime.Now; var TimeTotal = TimeFinish - TimeStart; Console.WriteLine(String.Format("TimeTotal: {0}", TimeTotal)); }
public void Tick_Import_with_assign_symbol_name_test() { string symbol = "SBRF-3.14_FT"; ITransaction tickImportTransaction = new ImportTicksTransaction(this.tradingData.Get <ObservableCollection <Tick> >(), ProjectRootFolderNameFactory.Make() + "\\TestData\\SPFB.SBRF_130802_130802.txt", symbol); tickImportTransaction.Execute(); Assert.AreEqual(57256, this.tradingData.Get <IEnumerable <Tick> >().Count()); Assert.AreEqual(symbol, this.tradingData.Get <IEnumerable <Tick> >().First().Symbol); Assert.AreEqual(9826, this.tradingData.Get <IEnumerable <Tick> >().First().Price); Assert.AreEqual(9795, this.tradingData.Get <IEnumerable <Tick> >().Last().Price); }
public void Tick_Import() { string symbol = ""; ITransaction tickImportTransaction = new ImportTicksTransaction(this.tradingData.Get <ObservableCollection <Tick> >(), ProjectRootFolderNameFactory.Make() + "\\TestData\\SPFB.Si-9.15_150601_150602.txt", symbol); tickImportTransaction.Execute(); Assert.AreNotEqual(0, this.tradingData.Get <IEnumerable <Tick> >().Count()); Assert.AreEqual("SPFB.Si-9.15", this.tradingData.Get <IEnumerable <Tick> >().First().Symbol); Assert.AreEqual(54260, this.tradingData.Get <IEnumerable <Tick> >().First().Price); Assert.AreEqual(54632, this.tradingData.Get <IEnumerable <Tick> >().Last().Price); Assert.AreEqual(9, this.tradingData.Get <IEnumerable <Tick> >().Last().Volume); Assert.AreEqual("20150602,234840", this.tradingData.Get <IEnumerable <Tick> >().Last().DateTime.ToString("yyyyMMdd,HHmmss")); }