Overall Statistics Total Trades0Average Win0%Average Loss0%Compounding Annual Return0%Drawdown0%Expectancy0Net Profit0%Sharpe Ratio0Probabilistic Sharpe Ratio0%Loss Rate0%Win Rate0%Profit-Loss Ratio0Alpha0Beta0Annual Standard Deviation0Annual Variance0Information Ratio-1.105Tracking Error0.04Treynor Ratio0Total Fees$0.00Estimated Strategy Capacity$0Lowest Capacity Asset
import numpy as np
from datetime import timedelta
from QuantConnect.Securities.Option import OptionPriceModels

### <summary>
### Basic template algorithm simply initializes the date range and cash. This is a skeleton
### framework you can use for designing an algorithm.
### </summary>
class BasicTemplateAlgorithm(QCAlgorithm):
'''Basic template algorithm simply initializes the date range and cash'''

def Initialize(self):
self.SetStartDate(2017, 6, 1)
self.SetEndDate(2017, 6, 15)
self.SetWarmUp(30,Resolution.Daily) # Warm up technical indicators
self.option.SetFilter(-3, +3, timedelta(0), timedelta(30))
self.option.PriceModel = OptionPriceModels.CrankNicolsonFD()

self.Schedule.On(self.DateRules.EveryDay("IBM"),self.TimeRules.AfterMarketOpen("IBM", 60),Action(self.print_first_hour))

def OnData(self, slice):
self.option_data = slice

def print_first_hour(self):
for chain in self.option_data.OptionChains.Values:
self.Log(f'{self.Time}--> Values of Delta: {[x.Greeks.Delta for x in chain]}')