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.653 Tracking Error 0.103 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.SetEndDate(2021, 12, 27) self.SetCash(100000) self.btc = self.AddCrypto("BTCUSD", Resolution.Minute, Market.GDAX).Symbol fourHourConsolidator = TradeBarConsolidator(timedelta(minutes=240)) 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(5*240*35, Resolution.Minute) def FourHourBarHandler(self, sender, bar): if self.IsWarmingUp: return if not self.macd.IsReady or not self.dmi.IsReady or not self.emaTwelve.IsReady: return self.Plot("MACD", "macd", self.macd.Current.Value) self.Plot("MACD", "signal", self.macd.Signal.Current.Value) self.Plot("DMI", "dmi", self.dmi.Current.Value)