Overall Statistics |
Total Trades 88 Average Win 2.19% Average Loss -0.54% Compounding Annual Return 22.295% Drawdown 10.300% Expectancy 2.080 Net Profit 54.279% Sharpe Ratio 1.424 Probabilistic Sharpe Ratio 71.830% Loss Rate 40% Win Rate 60% Profit-Loss Ratio 4.09 Alpha 0.164 Beta -0.061 Annual Standard Deviation 0.11 Annual Variance 0.012 Information Ratio 0.088 Tracking Error 0.246 Treynor Ratio -2.558 Total Fees $747.58 Estimated Strategy Capacity $1200000.00 Lowest Capacity Asset BTCBUSD 18N |
class RetrospectiveMagentaAlbatross(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 1, 1) self.SetCash(1000000) self.crypto = self.AddCrypto("BTCBUSD", Resolution.Minute, Market.Binance).Symbol self.bond = self.AddEquity('IEF', Resolution.Minute).Symbol self.rsi = self.RSI(self.crypto, 14, MovingAverageType.Simple, Resolution.Daily) self.SetWarmUp(14 + 1, Resolution.Daily) def OnData(self, data): if self.IsWarmingUp: return if not self.rsi.IsReady: return if not self.Portfolio[self.crypto].Invested and self.rsi.Current.Value >= 72: self.SetHoldings(self.crypto, 0.3) self.SetHoldings(self.bond, 0.7) elif self.Portfolio[self.crypto].Invested and self.rsi.Current.Value < 72: self.SetHoldings(self.crypto, 0) self.SetHoldings(self.bond, 1.0)