Overall Statistics
namespace QuantConnect 
{   
    public class ConsolidatorAlgorithm : QCAlgorithm
    {
    	public string Symbol = "WFM";
    	public DateTime sampledToday = DateTime.Now;
    	public MoneyFlowIndex MFIFifteen;
    	MoneyFlowIndex mfidaily;

        //Initialize the data and resolution you require for your strategy:
        public override void Initialize() 
        {
            SetStartDate(2014, 01, 01);         
            SetEndDate(2015, 01, 01);
            SetCash(25000);
            AddSecurity(SecurityType.Equity, Symbol, Resolution.Minute);
            mfidaily = MFI(Symbol, 14, Resolution.Daily);

            var fifteenMinute = new TradeBarConsolidator(TimeSpan.FromMinutes(15));
            SubscriptionManager.AddConsolidator(Symbol, fifteenMinute);
            fifteenMinute.DataConsolidated += OnFifteenMinuteData;
            // define our 15 minute money flow indicator
            MFIFifteen = new MoneyFlowIndex(14);
            RegisterIndicator(Symbol, MFIFifteen, fifteenMinute);
        }
        
        // THis is 15 minute activities
        public void OnFifteenMinuteData(object sender, TradeBar bar)
        {

			if (MFIFifteen < 20)
			{
				Order(Symbol, 100);
				Debug("Below 20 mfi15 is " + MFIFifteen);
			}
 
            if (MFIFifteen > 80) 
            {
                Order(Symbol, -100);
                Debug("Above 80 mfi15 is "+ MFIFifteen);
           }
            
        }

		//THis is every one minute activities
        public void OnData(TradeBars data) 
        {
        	sampledToday = data[Symbol].Time;
        }
    }
}