public override void ApplyTo(StockSerie stockSerie) { FloatSerie sineSerie = null; FloatSerie sineLeadSerie = null; stockSerie.CalculateHilbertSineWave(stockSerie.GetSerie(StockDataType.CLOSE).CalculateEMA((int)this.parameters[0]), ref sineSerie, ref sineLeadSerie); this.series[0] = sineSerie; this.series[1] = sineLeadSerie; // Detecting events this.CreateEventSeries(stockSerie.Count); for (int i = 10; i < sineSerie.Count; i++) { this.eventSeries[0][i] = sineLeadSerie[i] > sineSerie[i]; this.eventSeries[1][i] = !this.eventSeries[0][i]; this.eventSeries[2][i] = this.eventSeries[0][i] && !this.eventSeries[0][i - 1]; this.eventSeries[3][i] = this.eventSeries[1][i] && !this.eventSeries[1][i - 1]; } }