Exemplo n.º 1
0
        public static bool WasClosed_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(/*dtCurr*/ dtPrev, lstScale[i]);
            dtTo   = CUtilTime.NormalizeMinutes(/*dtCurr*/ dtPrev, lstScale[i + 1]);


            if (dtFrom.Day == 23 && dtFrom.Hour == 18 && dtFrom.Minute == 55)
            {
                int tmp = 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);
        }