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 QuantConnect.Python import PythonData
from dateutil import parser
import decimal

class CustomLocalFile(PythonData):
    def GetSource(self, config, date, isLiveMode):
        
        return SubscriptionDataSource(
            self.url,
            SubscriptionTransportMedium.RemoteFile
        )


    def Reader(self, config, line, date, isLiveMode):

        local_data = CustomLocalFile()
        local_data.Symbol = config.Symbol

        local_data.Time = parser.parse('2015-01-02 09:36')
        # local_data.EndTime = local_data.Time + timedelta(minutes=1)

        local_data.Value = decimal.Decimal(1)
        local_data["Close"] = 1.0
        local_data["Open"] = 2.0
        local_data["High"] = 3.0
        local_data["Low"] = 4.0

        return local_data
        
class LocalVix(CustomLocalFile):
    url = 'file:///etc/resolv.conf'
    
    
class GaboTrainingIntradayVix(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2015, 1, 2)
        self.SetEndDate(2015, 1, 3)
        self.SetCash(100000)

        self.AddData(LocalVix, "VIX", Resolution.Minute)

        self.Schedule.On(
            self.DateRules.EveryDay('VIX'),
            self.TimeRules.At(9, 37),
            Action(self._trade),
        )

    def OnData(self, data):
        pass

    def _trade(self):
        # history_minute = self.History(["XIV"], 3, Resolution.Minute)
        self.Log("time: %s" % self.Time)
        self.Log('Working with history')
        self.Log(str(self.History(["VIX"], 2, Resolution.Minute)))
        self.Log('Working with self.Securities')
        self.Log('Close=%.2f - Open=%.2f - High=%.02f - Low=%.02f' % (
            self.Securities['VIX'].Close,
            self.Securities['VIX'].Open,
            self.Securities['VIX'].High,
            self.Securities['VIX'].Low,
            )
        )
        pass