Пример #1
0
        private IEnumerable <HistoricalData> GetData(MarketRequest request, string filename)
        {
            switch (request.DataType)
            {
            case DataType.Tick:
                return(LookupMessageFileParser.ParseFromFile(line => new HistoricalData(TickMessage.Parse(line).Timestamp, line), filename));

            case DataType.Daily:
                return(LookupMessageFileParser.ParseFromFile(line => new HistoricalData(DailyWeeklyMonthlyMessage.Parse(line).Timestamp, line), filename));

            default:
                throw new NotSupportedException();
            }
        }
Пример #2
0
        private Task <string> GetMarketFilename(MarketRequest request)
        {
            switch (request.DataType)
            {
            case DataType.Tick:
                return(_lookupClient.Historical.File.GetHistoryTickTimeframeAsync(request.MarketSymbol.Symbol, request.StartDate, request.EndDate, dataDirection: DataDirection.Oldest));

            case DataType.Daily:
                return(_lookupClient.Historical.File.GetHistoryDailyTimeframeAsync(request.MarketSymbol.Symbol, request.StartDate, request.EndDate, dataDirection: DataDirection.Oldest));

            default:
                throw new NotSupportedException();
            }
        }