public IndicatorsCreatorItem(TimeSpan timeFrame, string storagePath, IFinancialIndicator indicator) { TimeFrame = timeFrame; _timeFrameTicks = timeFrame.Ticks; StoragePath = storagePath; Indicator = indicator; }
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)); }
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); } }
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(); }