Overall Statistics
public class ConsolidatorDemoAlgorithm : QCAlgorithm
{
    private const string Symbol = "AMD";
    private SimpleMovingAverage sma50;
    
	public override void Initialize()
	{
	    SetStartDate(2018, 1, 1);         
        SetEndDate(2019, 1, 18);

		SetCash(10000);

		AddEquity(Symbol, Resolution.Minute);
        Securities[Symbol].SetDataNormalizationMode(DataNormalizationMode.SplitAdjusted);
        
		var minConsolidator = new TradeBarConsolidator(TimeSpan.FromMinutes(5));
		minConsolidator.DataConsolidated += OnDataConsolidated;
		SubscriptionManager.AddConsolidator(Symbol, minConsolidator);

		sma50 = new SimpleMovingAverage(Symbol, 50);
        RegisterIndicator(Symbol, sma50, minConsolidator);
	}

	public void OnDataConsolidated(object sender, TradeBar bar) {
	

		if(Time.Date.Day == 18 && Time.Date.Month == 1 && Time.Date.Year == 2019){	
			 Console.WriteLine("{0} close: {1} SMA50: {2} ", Time.ToString("u"), bar.Close, sma50);
			 
			 //For 10AM on this day, Thinkorswim shows bar close of 20.47, SMA 50 =20.26
		}
		 
	}

	public override void OnData(Slice data)
	{ 
		
	}
}