public virtual bool TurnOver(DataRowCollection rows, int index) { if (!AnalysisCommon.CheckTrendPeriod(index, rows.Count, TrendPeriod)) { return(false); } AnalysisCommon.TrendDirection before = AnalysisCommon.TrendDirection.None; AnalysisCommon.TrendDirection after = AnalysisCommon.TrendDirection.None; try { before = AnalysisCommon.CheckBeforeTrendDirection(rows, index, TrendPeriod); after = AnalysisCommon.CheckAfterTrendDirection(rows, index, TrendPeriod); } catch (Exception ex) { if (ex is SMANULLException) { return(false); } } if ((before == AnalysisCommon.TrendDirection.Down && after == AnalysisCommon.TrendDirection.Up) || (before == AnalysisCommon.TrendDirection.Up && after == AnalysisCommon.TrendDirection.Down)) { return(true); } return(false); }
public override bool Valid(DataRowCollection rows, int index) { if (AnalysisCommon.CheckAfterTrendDirection(rows, index, AnalysisCommon.TrendPeriod.Short) != AnalysisCommon.TrendDirection.Up) { return(false); } return(true); }