Overall Statistics |
Total Trades 1 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 $68.30 Estimated Strategy Capacity $2300000.00 Lowest Capacity Asset BTCUSD XJ |
class RetrospectiveFluorescentYellowGalago(QCAlgorithm): def Initialize(self): self.SetStartDate(2021,11,9) # Set Start Date self.SetEndDate(2021,11,9) self.initCash = 100000 self.SetCash("USD", self.initCash) # Set Strategy Cash self.SetCash("BTC", 0) # Set Initial BTC holding self.symbol = self.AddCrypto("BTCUSD", Resolution.Hour).Symbol self.btc = self.AddCrypto("BTCUSD", Resolution.Hour) self.SetBrokerageModel(BrokerageName.Binance, AccountType.Cash) def OnData(self, data): if not self.Portfolio.Invested: self.Debug("USD amount in cashbook (before trade):" + str(self.Portfolio.CashBook["USD"].Amount)) self.Debug("BTC amount in cashbook (before trade):" + str(self.Portfolio.CashBook["BTC"].Amount)) marketTicket = self.MarketOrder("BTCUSD", 1) self.Debug("Ordered quantity:" + str(marketTicket.Quantity)) self.Debug("Filled quantity:" + str(marketTicket.QuantityFilled)) self.Debug("Buy price:" + str(marketTicket.AverageFillPrice)) marketOrder = self.Transactions.GetOrderById(marketTicket.OrderId) parameters = OrderFeeParameters(self.btc, marketOrder) fee = self.btc.FeeModel.GetOrderFee(parameters).Value.Amount self.Debug("Brokerage fee:" + str(fee)) self.Debug("USD amount in cashbook (after trade):" + str(self.Portfolio.CashBook["USD"].Amount)) self.Debug("BTC amount in cashbook (after trade):" + str(self.Portfolio.CashBook["BTC"].Amount))