Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
0
Tracking Error
0
Treynor Ratio
0
Total Fees
$0.00
using QuantConnect.Indicators;



namespace QuantConnect.UPRO_TMF_w_Corr
{
    public class QCUGlobalRotation : QCAlgorithm
    {
        String last_seen_AAPL = "unknown";
        String last_seen_SPY = "unknown";
		String last_seen_VX1 = "unknown"; 


        public override void Initialize()
        {
            SetStartDate(2014, 1, 1);            SetEndDate(2014,1,15);  

            AddSecurity(SecurityType.Equity, "AAPL", Resolution.Minute);
            AddSecurity(SecurityType.Equity, "SPY", Resolution.Minute);
            
            AddData<Quandl>("CHRIS/CBOE_VX1", Resolution.Daily);

        }


		public void OnData(Quandl qdata)
		{
			this.last_seen_VX1 = string.Format("{0}|{1}|{2:F2}",
					"VX1",
					qdata.Time,
					qdata.Price);
		}

		//private bool first = true;
        public void OnData(TradeBars data)
        {
            try
            {	
				if (data.Keys.Contains("AAPL")) last_seen_AAPL = string.Format("{0}|{1}|{2:F2}",
					"AAPL",
					data["AAPL"].Time,
					data["AAPL"].Close);

				if (data.Keys.Contains("SPY")) last_seen_SPY = string.Format("{0}|{1}|{2:F2}",
					"SPY",
					data["SPY"].Time,
					data["SPY"].Close);
            }
            catch (Exception ex)
            {
                Error("OnTradeBar: " + ex.Message + "\r\n\r\n" + ex.StackTrace);
            }
        }
     
       	
       	public override void OnEndOfDay()
       	{
       		Log("Completed OnEndOfDay for  " + String.Format("Algo: {0} {1} {2} {3}", this.Time, last_seen_AAPL, last_seen_SPY, last_seen_VX1));
       	}
    }
}