示例#1
0
        public static bool IsClosed_D1(DateTime dtPrev, DateTime dtCurr, List <int> lstScale, ref DateTime dtFrom, ref DateTime dtTo)
        {
            dtFrom = CUtilTime.NormalizeDay(dtPrev);
            dtTo   = CUtilTime.NormalizeDay(dtCurr);


            if (
                (dtPrev.Date < dtCurr.Date))
            {
                return(true);
            }


            return(false);
        }
示例#2
0
        public static bool WasClosed_H1(DateTime dtPrev, DateTime dtCurr, List <int> lstScale, ref DateTime dtFrom, ref DateTime dtTo)
        {
            dtFrom = CUtilTime.NormalizeHour(dtCurr);
            dtTo   = CUtilTime.NormalizeHour(dtCurr.AddHours(1));


            if (
                (dtPrev.Date == dtCurr.Date && dtCurr.Hour > dtPrev.Hour) ||
                (dtPrev.Date < dtCurr.Date))
            {
                return(true);
            }


            return(false);
        }
示例#3
0
        public static bool IsClosed_M5_M15_M30_TF(DateTime dtPrev, DateTime dtCurr, List <int> lstScale, ref DateTime dtFrom, ref DateTime dtTo)
        {
            int i = -1;

            while (lstScale[i + 1] <= dtPrev.Minute)
            {
                i++;
            }

            dtFrom = CUtilTime.NormalizeMinutes(dtPrev, lstScale[i]);
            dtTo   = CUtilTime.NormalizeMinutes(dtPrev, lstScale[i + 1]);


            if ((dtPrev.Date == dtCurr.Date && dtPrev.Hour == dtCurr.Hour && i + 1 < lstScale.Count && dtCurr.Minute >= lstScale[i + 1]) ||
                (dtPrev.Date == dtCurr.Date && dtCurr.Hour > dtPrev.Hour) ||
                (dtPrev.Date < dtCurr.Date))
            {
                return(true);
            }


            return(false);
        }