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
Probabilistic 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
-2.6
Tracking Error
0.09
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
# VIX and VIX Days Ago

import numpy as np

class VAlgorithm(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2016, 3, 1)
        self.SetEndDate(2016, 5, 3)
        self.SetCash(100000)
        
        self.spy = self.AddEquity("SPY", Resolution.Minute).Symbol
        self.vix = self.AddData(CBOE, "VIX").Symbol
        days_ago = 21
        self.SetWarmup(days_ago + 1, Resolution.Daily)
        self.vix_price = self.SMA(self.vix, 1, Resolution.Daily)
        self.vix_days_ago =  IndicatorExtensions.Of(Delay(days_ago), self.vix_price)
        
        
    def OnData(self, data):
        if self.IsWarmingUp or not self.vix_price.IsReady or not self.vix_days_ago.IsReady: return
        if self.IsMarketOpen(self.spy) and (self.Time.hour == 9 and self.Time.minute == 31):
            
            self.Plot("VIX", "VIX Price ", self.vix_price.Current.Value)
            self.Plot("VIX", "VIX Price Days Ago", self.vix_days_ago.Current.Value)