Example #1
0
        protected override PatternResult <Crossover?> ComputeByIndexImpl(int index)
        {
            if (index < 1)
            {
                return(new PatternResult <Crossover?>(Equity[index].DateTime, null));
            }

            var latest       = _emaOscillator.ComputeByIndex(index);
            var secondLatest = _emaOscillator.ComputeByIndex(index - 1);

            return(new PatternResult <Crossover?>(Equity[index].DateTime, Decision.IsCrossover(latest.Osc, secondLatest.Osc)));
        }