public override void ApplyTo(StockSerie stockSerie) { this.CreateEventSeries(stockSerie.Count); List<StockEvent.EventType> eventTypes = new List<StockEvent.EventType>(); foreach (string eventName in eventNames) { eventTypes.Add((StockEvent.EventType)Enum.Parse(typeof(StockEvent.EventType), eventName)); } // for (int i = 2; i < stockSerie.Count; i++) { int eventNum = 0; foreach (StockEvent.EventType eventType in eventTypes) { this.Events[eventNum++][i] = stockSerie.DetectEvent(eventType, i); } } }