Overall Statistics
using System;
using System.Collections;
using System.Collections.Generic; 
using QuantConnect.Securities;  
using QuantConnect.Models;   

namespace QuantConnect 
{   
    // Name your algorithm class anything, as long as it inherits QCAlgorithm
    public class BasicTemplateAlgorithm : QCAlgorithm
    {
        string _symbol = "SPY";
        DateTime _date = new DateTime(2014, 12, 1);
        TradeBars _lastBars = null;
        
        //Initialize the data and resolution you require for your strategy:
        public override void Initialize()
        {
            SetStartDate(2014, 12, 1);
            SetEndDate(2014, 12, 4);
            SetCash(25000);
            AddSecurity(SecurityType.Equity, _symbol, Resolution.Minute);
        }

        //Data Event Handler: New data arrives here. "TradeBars" type is a dictionary of strings so you can access it by symbol.
        public void OnData(TradeBars data) 
        {  
            if (!data.ContainsKey(_symbol)) return;
            if (!Portfolio.Invested) Order(_symbol, 100);
            if (_lastBars == null) _lastBars = data;
            
            if (Time.Date != _date.Date)
            {
                _date = Time;
                Log("PRICES: BarDate>" + _lastBars[_symbol].Time.ToShortDateString() + "> Time> " + _lastBars[_symbol].Time.ToShortTimeString() + " Close > " + _lastBars[_symbol].Close.ToString("C"));
            }
            _lastBars = data;
        }
    }
}