Exemplo n.º 1
0
        public DTick GetTickXMinutesOld(int minutes)
        {
            var time = GeneralUtils.RoundUp(DateTime.Now.AddMinutes(-minutes), TimeSpan.FromMinutes(1));

            while (MarketUtils.IsTimeAfter915(time) && !AllTicks.ContainsKey(time) || AllTicks[time].Count == 0)
            {
                time = time.AddMinutes(-1);
            }

            if (AllTicks.ContainsKey(time))
            {
                return(AllTicks[time][0]);
            }
            else
            {
                return(null);
            }
        }