Overall Statistics |
Total Trades 51 Average Win 25.37% Average Loss -6.29% Compounding Annual Return 643.472% Drawdown 33.200% Expectancy 1.416 Net Profit 647.569% Sharpe Ratio 6.286 Probabilistic Sharpe Ratio 98.156% Loss Rate 52% Win Rate 48% Profit-Loss Ratio 4.03 Alpha -0.38 Beta 0.883 Annual Standard Deviation 0.562 Annual Variance 0.315 Information Ratio -4.239 Tracking Error 0.212 Treynor Ratio 3.998 Total Fees $165.01 Estimated Strategy Capacity $370000.00 Lowest Capacity Asset BTCUSD 2MN |
class CalmLightBrownKitten(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 4, 1) self.SetEndDate(2021, 4 , 1) self.SetCash(1000) self.crypto = self.AddCrypto("BTCUSD", Resolution.Minute, Market.FTX).Symbol self.SetBrokerageModel(BrokerageName.FTX, AccountType.Margin) self.entryPrice = 0 self.roc = self.ROC(self.crypto, 6, Resolution.Hour) def OnData(self, data): if self.Time.minute != 1: return price = self.Securities[self.crypto].Price if not self.Portfolio[self.crypto].Invested: if self.roc.Current.Value < -0.01: self.SetHoldings(self.crypto, 0.99) self.entryPrice = price elif self.Portfolio[self.crypto].Invested: if price < self.entryPrice * 0.95: self.Liquidate(self.crypto, "Stop Loss") self.entryPrice = 0 elif price >= self.entryPrice * 1.25: self.Liquidate(self.crypto, "Take Profit") self.entryPrice = 0