Overall Statistics
namespace QuantConnect.Algorithm.CSharp
{
    public class HorizontalVerticalAutosequencers : QCAlgorithm
    {
    	
    	string security = "MSFT";
    	RollingWindow<TradeBar> tradeBars;
        public override void Initialize()
		{
		    SetCash(100000);
		
		    SetStartDate(new DateTime(2020, 3, 1));
		    SetEndDate(new DateTime(2020, 3, 9));
		
		
		    AddEquity(security, Resolution.Minute);
		    
		    tradeBars = new RollingWindow<TradeBar>(50);
		
		    SetWarmup(50);

		}

		public override void OnData(Slice data)
		{	
			if(data.ContainsKey(security)){
				var bar = data.Bars[security];
				tradeBars.Add(bar);
			}
			
			if(!data.ContainsKey(security) || data[security] == null) {
		        Debug(string.Format("Security {0} not found @ {1} and ContainsKey {2}.", security, Time, data.ContainsKey(security)));
		        
		     }
			
		    if (IsWarmingUp) return;
		   
		        		
		    if(tradeBars.IsReady){
		          var firstBar = tradeBars.First();
		          var lastBar = tradeBars.Last();
		          var currentTrade = data.Bars[security];
		          Debug(string.Format("firstBar.Time: {0}, lastBar.Time {1}, currentTrade {2}", firstBar.Time, lastBar.Time, currentTrade.Time));
		     }
		}
    }
}