Overall Statistics
namespace QuantConnect 
{   

    public class FUB_MissingTrades : QCAlgorithm
    {
    	List<string> _symbols = new List<string>() {"AAPL", "AMZN" , "NFLX", "TSLA"};

    	//----------------------------------------------------------------------
        // Initialize the data and resolution you require for your strategy:
        public override void Initialize() 
        {
            SetStartDate(2015, 1, 1);  
            SetEndDate(2015, 12, 31);

            SetCash(2e6);
            
            foreach(var symbol in _symbols)
            {
	            AddSecurity(SecurityType.Equity, symbol, Resolution.Daily);
	            
	            //Chart - Master Container for the Chart:
            	var stockPlot = new Chart(symbol + " trade plot");
            	//On the Trade Plotter Chart we want 3 series: trades and price:
            	var buyOrders = new Series("Buy", SeriesType.Scatter, 0);
            	var sellOrders = new Series("Sell", SeriesType.Scatter, 0);
            	stockPlot.AddSeries(buyOrders);
            	stockPlot.AddSeries(sellOrders);
            	AddChart(stockPlot);
            }
            
            
        }

    	//----------------------------------------------------------------------
        // Data Event Handler: New data arrives here.
        public void OnData(TradeBars data) 
        {   
        	foreach(var bar in data.Values)
        	{
        		// adjust investment to $10k
                var netValue = Portfolio[bar.Symbol].Quantity * Portfolio[bar.Symbol].Price;
                int deltaShares = (int)Math.Floor((10000 - netValue) / Portfolio[bar.Symbol].Price);
                if (deltaShares != 0)
                {
	                var newTicket = MarketOnOpenOrder(bar.Symbol, deltaShares);
                }
        	}
        }
        
        public override void OnOrderEvent(OrderEvent orderEvent)
        {
        	if(orderEvent.Status == OrderStatus.Filled)
        	{
        		var chartName = orderEvent.Symbol + " trade plot";
        		if(orderEvent.FillQuantity > 0)
        			Plot(chartName, "Buy", orderEvent.FillPrice);
        		else
        			Plot(chartName, "Sell", orderEvent.FillPrice);
        	}        	
        }
    }
}