public CsvCandleDataSource(string csvPath, MarketFeedSettings settings, CsvLastRunDataStore parent, ILogger <CsvCandleDataSource> logger)
 {
     _csvPath = csvPath; // TODO: clean this up & use in CsvLastRunDataStore
     Settings = settings;
     _parent  = parent;
     _logger  = logger;
 }
Esempio n. 2
0
 internal CsvLastRunStoreSerializer(CsvLastRunDataStore store)
 {
     Minutes1  = store._minutes1;
     Minutes5  = store._minutes5;
     Minutes15 = store._minutes15;
     Hour1     = store._hour1;
     Hour6     = store._hour6;
     Hour24    = store._hour24;
 }
Esempio n. 3
0
        public ICandleDataSource Load(MarketFeedSettings settings)
        {
            if (settings == null)
            {
                return(null);
            }

            if (!_lastRun.ContainsKey(settings.ProductId))
            {
                _lastRun.Add(settings.ProductId, CsvLastRunDataStore.Load(_appSettings.CsvPath, settings.ProductId));
            }

            if (DataStores.ContainsKey(settings))
            {
                return(DataStores[settings]);
            }

            var rc = new CsvCandleDataSource(_appSettings.CsvPath, settings, _lastRun[settings.ProductId], _logger);

            DataStores.Add(settings, rc);
            return(rc);
        }