Esempio n. 1
0
        public override double GetPercentComplete(Bars bars, DateTime now)
        {
            if (SessionIterator == null || SessionIterator.ActualTradingDayExchange == Core.Globals.MinDate)
            {
                return(1);
            }
            DateTime tradingDayBegin = SessionIterator.GetTradingDayBeginLocal(SessionIterator.ActualTradingDayExchange);

            return(now > tradingDayBegin && now < SessionIterator.ActualTradingDayEndLocal ? now.Subtract(tradingDayBegin).TotalSeconds / SessionIterator.ActualTradingDayEndLocal.Subtract(tradingDayBegin).TotalSeconds : 1);
        }