Overall Statistics
namespace QuantConnect.Algorithm.CSharp
{
    public class ParticleResistanceThrustAssembly : QCAlgorithm
    {
		private List<Symbol> _symbol_list;
        public override void Initialize()
        {
            SetStartDate(2019, 2, 27);  //Set Start Date
            SetEndDate(2019, 3, 12);
            SetCash(100000);             //Set Strategy Cash
            _symbol_list = new List<Symbol>();
            
            // AddEquity("SPY", Resolution.Minute);

			SetUniverseSelection(new CoarseFundamentalUniverseSelectionModel(CoarseSelectionFunction));

        }

        /// 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");
            //}
        }
		// sort the data by daily dollar volume and take the top 'NumberOfSymbols'
		public IEnumerable<Symbol> CoarseSelectionFunction(IEnumerable<CoarseFundamental> coarse)
		{
			foreach (CoarseFundamental c in coarse){
				if (_symbol_list.Contains(c.Symbol)){
					continue;
				}
				AddEquity(c.Symbol, Resolution.Minute);
				var consolidator = new TradeBarConsolidator(TimeSpan.FromMinutes(5));
				consolidator.DataConsolidated += (sender, bar) => {
					// Do something with 5-minute bar arrives
				};
				SubscriptionManager.AddConsolidator(c.Symbol, consolidator);
				_symbol_list.Add(c.Symbol);
			}
		    return _symbol_list;
		}

    }
}