예제 #1
0
        public static Type Check(Chart.ChartLine line, Data.SymbolDayData sdd)
        {
            bool cross = Misc.LineValueOnSdd(line, sdd);

            bool upCandle   = sdd.Open < sdd.Close;
            bool downCandle = !upCandle;

            bool upLine = line.getP1().X > line.getP2().X ?
                          line.getP1().Y <line.getP2().Y : line.getP1().Y> line.getP2().Y;

            bool downLine = !upLine;

            if (cross && upCandle && upLine)
            {
                return(Type.CrossUpLineWithTrend);
            }
            else if (cross && downCandle && downLine)
            {
                return(Type.CrossDownLineWithTrend);
            }

            return(Type.Nothing);
        }
예제 #2
0
 public static float LineLength(Chart.ChartLine line)
 {
     return(PointPointDistance(line.getP1(), line.getP2()));
 }