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
-6.147
Tracking Error
0.057
Treynor Ratio
0
Total Fees
$0.00
from QuantConnect.Data.Custom.CBOE import *

class VentralTachyonAtmosphericScrubbers(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2017, 12, 6)  # Set Start Date
        self.SetEndDate(2018, 1, 1)
        self.SetCash(500)  # Set Strategy Cash

        self.vixsmStr = "VIX9D"
        self.AddData(CboeVixsm, "VIX9D")

    def OnData(self, data):
        if self.vixsmStr in data:
            vixsmPrice = data[self.vixsmStr].Close
    
            self.Plot("vix9D", "vixsmClose", vixsmPrice)
            
            
class CboeVixsm(PythonData):
    '''CBOE Vix Download Custom Data Class'''
    def GetSource(self, config, date, datafeed):
        url_vix = "http://cache.quantconnect.com/alternative/cboe/vix9d.csv"
        return SubscriptionDataSource(url_vix, 
                                      SubscriptionTransportMedium.RemoteFile)
    def Reader(self, config, line, date, datafeed):
        if not (line.strip() and line[0].isdigit()): return None
        # New CboeVix object
        index = CboeVixsm();
        index.Symbol = config.Symbol
        try:
            # Example File Format:
            # Date          VIX Open    VIX High VIX Low    VIX Close
            # 01/02/2004    17.96    18.68     17.54        18.22
            #print line
            data = line.split(',')
            date = data[0].split('/')
            index.Time = datetime(int(date[2]), int(date[0]), int(date[1]))
            index.Value = float(data[4])
            index["Open"] = float(data[1])
            index["High"] = float(data[2])
            index["Low"] = float(data[3])
            index["Close"] = index.Value
        except ValueError:
            return None
        return index