Example #1
0
        /// <summary>
        /// Construye un Reader configurado para iterar un archivo (correspondiente a un día) de la serie.
        /// </summary>
        /// <param name="filePath"></param>
        public static SeriesReader CreateReaderForSingleFile(string filePath)
        {
            if (!filePath.EndsWith(".bin"))
            {
                throw new Exception("I expect a .bin file path.");
            }
            SeriesReader reader = new SeriesReader();

            reader._begin = DateTime.MinValue;
            reader._end   = DateTime.MaxValue;
            reader._paths.Enqueue(filePath);
            return(reader);
        }
Example #2
0
        public SeriesInformation(string providerFolder)
        {
            ProviderDescriptor descriptor = new ProviderDescriptor(providerFolder);
            var filePaths = descriptor.YearDescriptors
                            .SelectMany(y => y.MonthDescriptors
                                        .SelectMany(m => m.DayDescriptors
                                                    .Select(d => d.Path)));
            DateTime dateTime;
            decimal  ask, bid;

            SeriesReader.CreateReaderForSingleFile(filePaths.First()).Next(out dateTime, out ask, out bid);
            Begin = dateTime;
            var reader = SeriesReader.CreateReaderForSingleFile(filePaths.Last());

            while (reader.Next(out dateTime, out ask, out bid))
            {
                End = dateTime;
            }
        }