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 7.33 Tracking Error 0.104 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset |
#region imports from AlgorithmImports import * #endregion class RetrospectiveTanButterfly(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 9, 17) # Set Start Date self.SetEndDate(2020, 10, 23) self.SetCash(1000000000) # Set Strategy Cash self.symbolData = {} self.contract = self.AddFuture(Futures.Energies.CrudeOilWTI , Resolution.Tick, extendedMarketHours = False, dataNormalizationMode = DataNormalizationMode.BackwardsRatio, dataMappingMode = DataMappingMode.OpenInterest , contractDepthOffset = 0) symbol = self.contract.Symbol #symbol.SetFilter(0, 90) #Futures.Grains.Corn, Futures.Indices.SP500EMini, Futures.Energies.CrudeOilWTI self.symbolData[symbol] = SymbolData() self.symbolData[symbol].bidPrice = self.Securities[symbol].BidPrice self.symbolData[symbol].askPrice = self.Securities[symbol].AskPrice def OnData(self, data): for changedEvent in data.SymbolChangedEvents.Values: if changedEvent.Symbol == self._continuousContract.Symbol: self.Log(f"SymbolChanged event: {changedEvent}") self.Log(f"contract mapped symbol: {self.contract.Mapped}") for symbol, symbolData in self.symbolData.items(): if not data.Ticks.ContainsKey(symbol): continue #underlying = symbol.Underlying def OnEndOfDay(self, symbol): symbolData = self.symbolData[symbol] self.Log(f"end of day") class SymbolData: def __init__(self): self.buyVolume = 0 self.sellVolume = 0