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 -1.105 Tracking Error 0.04 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest 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.AddEquity("IBM", Resolution.Minute) self.option = self.AddOption("IBM", Resolution.Minute) 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]}')