Overall Statistics
namespace QuantConnect.Algorithm.CSharp
{
    public class TransdimensionalVentralFlange : QCAlgorithm
    {
    	IEnumerable<Symbol> MyCoarseFilterFunction(IEnumerable<CoarseFundamental> coarse) {
	        var stocks = (from c in coarse
	            where c.DollarVolume > 3000000 &&
	                  c.Price > 15
	            orderby c.DollarVolume descending
	            select c.Symbol).Take(1).ToList();
	        return stocks;
	    }

        public override void Initialize()
        {
            SetStartDate(2019, 9, 10);  //Set Start Date
            SetEndDate(2019, 9, 11);  //Set Start Date
            SetCash(100000);             //Set Strategy Cash
            

			UniverseSettings.Resolution = Resolution.Minute;
			AddUniverse(MyCoarseFilterFunction);
        }

        /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
        /// Slice object keyed by symbol containing the stock data
        public override void OnData(Slice data)
        {
            // if (!Portfolio.Invested)
            // {
            //    SetHoldings(_spy, 1);
            //    Debug("Purchased Stock");
            //}
            
            //Debug($"Time={data.Time}");
            if (data.ContainsKey("SPY") == false) {
            	Debug($"time={data.Time}, no SPY key");
	    		return;
            }
	    		
	    	var bar = data["SPY"];
            if (bar == null) {
            	Debug($"time={data.Time}, no SPY bar");
            	return;
            }
        }
	
		
		public override void OnSecuritiesChanged(SecurityChanges changes)
        {
        	Debug($"Main->OnSecuritiesChanged({changes.RemovedSecurities.Count}), RemovedSecurities: "+string.Join(",", changes.RemovedSecurities.Select(x => x.Symbol.Value)));
        	Debug($"Main->OnSecuritiesChanged({changes.AddedSecurities.Count}), AddedSecurities: "+string.Join(",", changes.AddedSecurities.Select(x => x.Symbol.Value)));


        	foreach (var removed in changes.RemovedSecurities)
            {
            	
            }
                
        	foreach (var added in changes.AddedSecurities)
            {
            
            }
			
        }
		
    }
}