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.503 Tracking Error 0.102 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset |
class DeterminedRedCat(QCAlgorithm): def Initialize(self): self.SetStartDate(2021, 5, 1) self.SetCash(100000) self.btc = self.AddCrypto("BTCUSD", Resolution.Minute, Market.GDAX).Symbol self.fourHourWindow = RollingWindow[TradeBar](2) fourHourConsolidator = TradeBarConsolidator(timedelta(hours=4)) fourHourConsolidator.DataConsolidated += self.FourHourBarHandler self.SubscriptionManager.AddConsolidator(self.btc, fourHourConsolidator) self.macd = MovingAverageConvergenceDivergence(12, 26, 9, MovingAverageType.Exponential) self.RegisterIndicator(self.btc, self.macd, fourHourConsolidator) self.dmi = AverageDirectionalIndex(14) self.RegisterIndicator(self.btc, self.dmi, fourHourConsolidator) self.emaTwelve = ExponentialMovingAverage(12) self.RegisterIndicator(self.btc, self.emaTwelve, fourHourConsolidator) self.SetWarmup(timedelta(hours=140)) def OnData(self, data): if self.IsWarmingUp or self.btc not in data or not self.fourHourWindow.IsReady: return def FourHourBarHandler(self, sender, bar): self.fourHourWindow.Add(bar) if not self.macd.IsReady or not self.dmi.IsReady or not self.emaTwelve.IsReady or not self.fourHourWindow.IsReady: return self.Debug("fourHourWindow close: " + str(self.fourHourWindow[0].Close) + " " + str(self.fourHourWindow[0].Time)) self.Debug("MACD: " + str(self.macd.Current.Value) + " Histogram: " + str(self.macd.Histogram.Current.Value)) self.Debug("ADX: " + str(self.dmi.Current.Value) + " DMI+: " + str(self.dmi.PositiveDirectionalIndex.Current.Value) + " DMI-: " + str(self.dmi.NegativeDirectionalIndex.Current.Value)) self.Debug("emaTwelve: " + str(self.emaTwelve.Current.Value))