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 -8.276 Tracking Error 0.117 Treynor Ratio 0 Total Fees $0.00 |
class ModulatedDynamicComputer(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 7, 1) # Set Start Date self.SetCash(100000) # Set Strategy Cash self.tickers = ["SPY","QQQ"] self.equity = {} self.option = {} self.symbols = [] for ticker in self.tickers: symbol = self.AddEquity(ticker, Resolution.Minute) option = self.AddOption(ticker, Resolution.Minute) option.SetFilter(-50, +50, 1, 90) self.symbols.append(option.Symbol) self.Schedule.On(self.DateRules.EveryDay("SPY"), self.TimeRules.At(9,35), self.removeSecurities ) def removeSecurities(self): self.Debug(f"Method called at {self.Time}") self.Debug(f"Active Securities ...") for security in self.ActiveSecurities: symbol = security.Key self.Debug(symbol.Value) self.Debug(f"Removed Securities ...") for symbol in self.symbols: self.Debug(symbol.Value) self.RemoveSecurity(symbol) def OnData(self, slice): for chain in slice.OptionChains.Values: #iterate thru each chain in the slice self.Debug(str(self.Time) + " OnData fired for symbol " + str(chain.Symbol.Value)) return