示例#1
0
文件: Robot.cs 项目: RomanS2N/trading
 private void VerifyOldFiles(SeriesDescriptor seriesDescriptor)
 {
     seriesDescriptor.InstrumentDescriptors.ForEach(instrumentDescriptor => {
         instrumentDescriptor.ProviderDescriptors.ForEach(providerDescriptor => {
             // si no tiene VerificationReport, lo verifico
             Directory.GetFiles(providerDescriptor.Path, "*.csv").ToList().ForEach(csvFileName => {
                 string reportFileName     = csvFileName.Replace(".csv", ".xml");
                 VerificationReport report = VerificationReport.LoadFromFile(reportFileName);
                 if (report == null || !report.Verified)
                 {
                     Verify(csvFileName);
                 }
             });
         });
     });
 }
示例#2
0
文件: Robot.cs 项目: RomanS2N/trading
 private void Convert(string providerPath)
 {
     Directory.GetFiles(providerPath, "*.xml").ToList().ForEach(reportFile => {
         string dataFile = reportFile.Replace(".xml", ".csv");
         if (File.Exists(dataFile))
         {
             VerificationReport verificationReport = VerificationReport.LoadFromFile(reportFile);
             if (verificationReport.Verified && !verificationReport.TransformationCompleted)
             {
                 ISeriesConverter converter     = new SeriesConverter();
                 QuotesProcessor processor      = new QuotesProcessor(providerPath);
                 RawDataInformation information = RawDataInformation.FromPath(reportFile);
                 Console.WriteLine("Creating prices from {0}", dataFile);
                 converter.ImportQuotes(dataFile, processor, information.Begin, information.End);
                 verificationReport.TransformationCompleted = true;
                 verificationReport.SaveToFile(reportFile);
             }
         }
         else
         {
             Console.WriteLine("{0} file does not exist!", dataFile);
         }
     });
 }