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 0 Tracking Error 0 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset |
class UncoupledVentralPrism(QCAlgorithm): def Initialize(self): self.SetStartDate(2021, 8, 31) self.SetEndDate(2021, 8, 31) self.SetCash(100000) future = self.AddFuture(Futures.Indices.SP500EMini, Resolution.Minute) future.SetFilter(timedelta(0), timedelta(180)) self.Consolidate(future.Symbol, timedelta(minutes=5), self.customBarHandler) self.macd = self.MACD(future.Symbol, 12, 26, 9, MovingAverageType.Exponential, Resolution.Minute) self.macd.Updated += self.macdUpdated self.macdWindow = RollingWindow[IndicatorDataPoint](10) self.RegisterIndicator(future.Symbol, self.macd, timedelta(minutes=5)) self.tradeBarWindow = RollingWindow[QuoteBar](10) self.currentDate = 0 self.currentMinute = 0 def OnData(self, data): if self.currentMinute == self.Time.minute: return for chain in data.FutureChains: contracts = [contract for contract in chain.Value] self.Debug("------------") sorted_contracts = sorted(contracts, key=lambda x: x.Expiry) for c in sorted_contracts: self.Debug("symbol : {} and expiry : {}".format(c.Symbol.Value, c.Expiry)) self.Debug("close price : {} and open price : {}".format(data[c.Symbol].Close, data[c.Symbol].Open)) self.Debug("rolling window : ") if len(sorted_contracts) == 0: self.Debug("nothing") self.currentMinute = self.Time.minute def customBarHandler(self, bar): self.tradeBarWindow.Add(bar) def macdUpdated(self, sender, updated): self.macdWindow.Add(updated)