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
from System import *
from QuantConnect import *
from QuantConnect.Algorithm import *
from QuantConnect.Python import PythonQuandl
from datetime import datetime, timedelta

class QuandlFuturesDataAlgorithm(QCAlgorithm):

    def Initialize(self):
        ''' Initialize the data and resolution you require for your strategy '''
        self.SetStartDate(2018, 1, 1)
        self.SetEndDate(datetime.now().date() - timedelta(1))
        self.SetCash(25000);

        # Symbol corresponding to the quandl code
        self.AddData(QuandlVix, "CBOE/VIX", Resolution.Daily)
        # self.AddData[Quandl]("CBOE/VXV", Resolution.Daily)


    def OnData(self, data):
        '''Data Event Handler: New data arrives here. "TradeBars" type is a dictionary of strings so you can access it by symbol.'''
        if not data.ContainsKey("CBOE/VIX"): return 
        
        self.Plot("VIX", "Price", data["CBOE/VIX"].Price)
        self.Debug("vix close: %s" % (data["CBOE/VIX"].Price))
        # self.Plot("VXV", "Close", data["CBOE/VXV"].Price)
        
class QuandlVix(PythonQuandl):
    
    def __init__(self):
        self.ValueColumnName = "vix close"