Overall Statistics
using System.Runtime.CompilerServices;

namespace QuantConnect 
{   
    public class BasicTemplateAlgorithm : QCAlgorithm
    {
    	private bool first;
        public override void Initialize() 
        {
        	first=true;
            SetStartDate(2013, 1, 1);         
            SetEndDate(DateTime.Now.Date.AddDays(-1));
            SetCash(25000);
            AddSecurity(SecurityType.Equity, "SPY", Resolution.Minute);
        }
        public void OnData(TradeBars data) 
        {   
        	if(first)
            {
            	first=false;
                int quantity = (int)Math.Floor(Portfolio.Cash / data["SPY"].Close);
                Order("SPY",  quantity);
                Debug("Purchased SPY on " + Time.ToShortDateString());
                Log(msgWithLine("This is a longer message send to log."));
            }
        }
        
        public string msgWithLine(string msg, [CallerLineNumber] int sourceLineNumber = 0)
        {
        	return "Linenumber="+sourceLineNumber+" "+msg;
        }
    }
}