Overall Statistics
namespace QuantConnect 
{   
    /*
    *   QuantConnect University: Generic Quandl Data Importer
    *
    *   Using the underlying dynamic data class "Quandl" we take care of the data 
    *   importing and definition for you. Simply point QuantConnect to the Quandl Short Code.
    *
    *   The Quandl object has properties which match the spreadsheet headers.
    *   If you have multiple quandl streams look at data.Symbol to distinguish them.
    */
    public class QCUQuandlImporter : QCAlgorithm
    {
        string dividendCode = "NASDAQOMX/OMXS30";
        
        //Initialize the data and resolution you require for your strategy:
        public override void Initialize()
        {
            SetCash(25000);
            SetStartDate(2017, 1, 1);         
            SetEndDate(DateTime.Now.Date.AddDays(-1)); 
            
            //Add Generic Quandl Data:
            AddSecurity(SecurityType.Equity, "AAPL", Resolution.Minute);
            AddData<QuandlSEC>(dividendCode, Resolution.Daily);
        }
        
        public override void OnData(Slice data) 
        {
        	if (!Portfolio.Invested) Order("AAPL", 100);
        	
            var quandls = data.Get<Quandl>();
            foreach(var key in quandls.Keys) {
            	Console.WriteLine(Time.ToString("o") + key + " " + quandls[key]); 
            }
        }
    }
    
    // Custom quandl data type for setting customized value column name. 
    // Value column is used for the primary trading calculations and charting.
    public class QuandlSEC : Quandl {
        public QuandlSEC() : base(valueColumnName: "Index Value") 
        {
        }
    }
}