Esempio n. 1
0
 public IndicatorsCreatorItem(TimeSpan timeFrame, string storagePath, IFinancialIndicator indicator)
 {
     TimeFrame       = timeFrame;
     _timeFrameTicks = timeFrame.Ticks;
     StoragePath     = storagePath;
     Indicator       = indicator;
 }
Esempio n. 2
0
        public void AddIndicator(IFinancialIndicator indicator)
        {
            var found = _indicatorsCreatorItems.SingleOrDefault(ind => ind.Indicator.Identifier == indicator.Identifier);

            if (found != null)
            {
                _indicatorsCreatorItems.Remove(found);
            }
            _indicatorsCreatorItems.Add(new IndicatorsCreatorItem(TimeFrame, StoragePath, indicator));
        }
Esempio n. 3
0
 public static IndicatorsReader Create(IFinancialIndicator indicator, TimeSpan timeFrame, string storagePath)
 {
     try {
         return(new IndicatorsReader(indicator, timeFrame, storagePath));
     }
     catch (Exception e) {
         Console.WriteLine(e.Message);
         return(null);
     }
 }
Esempio n. 4
0
 private IndicatorsReader(IFinancialIndicator indicator, TimeSpan timeFrame, string storagePath)
 {
     _indicator      = indicator;
     TimeFrame       = timeFrame;
     _timeFrameTicks = TimeFrame.Ticks;
     StoragePath     = storagePath;
     if (storagePath == null)
     {
         throw new Exception("storagePath can't be null.");
     }
     MapFiles();
 }