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
-3.17
Tracking Error
0.457
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
### 2020_12_17 Buffer v2
### ----------------------------------------------------------------------------
### Restructured code and now we do not subscribe to options data in Initialize
### but we search through the chain every time we roll to make the algo much faster
### ----------------------------------------------------------------------------

from clr import AddReference
AddReference("System")
AddReference("QuantConnect.Algorithm")
AddReference("QuantConnect.Common")

from System import *
from QuantConnect import *
from QuantConnect.Algorithm import *

from QuantConnect.Securities.Option import *

class TestingIndexOptionsAlgorithm(QCAlgorithm):

    def Initialize(self):
        
        self.SetStartDate(2019, 1, 1)
        self.SetEndDate(2019, 1, 5)
        self.SetCash(1000000)
        
        # add data for underlying
        underlying = self.AddIndex('VIX', Resolution.Minute)
        underlying.SetDataNormalizationMode(DataNormalizationMode.Raw)
        self.underlyingSymbol = underlying.Symbol

    def OnData(self, data):
            
        if self.Time.hour == 9 and self.Time.minute < 35:
        
            # get all contracts available now
            contracts = self.OptionChainProvider.GetOptionContractList(self.underlyingSymbol, self.Time.date())
            if len(contracts) == 0:
                self.Log('no contracts found in OptionChainProvider')
                return
            
            # get the relevant contracts using a range of expiry dates
            #relevantContracts = [x for x in contracts if OptionSymbol.IsStandardContract(x)]
    
            #self.Log(relevantContracts)