Overall Statistics |
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 17.290% Drawdown 16.600% Expectancy 0 Net Profit 27.278% Sharpe Ratio 0.543 Sortino Ratio 0.735 Probabilistic Sharpe Ratio 39.026% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0 Beta 0.993 Annual Standard Deviation 0.141 Annual Variance 0.02 Information Ratio -0.894 Tracking Error 0.001 Treynor Ratio 0.077 Total Fees $1.35 Estimated Strategy Capacity $500000000.00 Lowest Capacity Asset SPY R735QTJ8XC9X Portfolio Turnover 0.18% |
# region imports from AlgorithmImports import * # endregion class CustomBrokerageModelAlgorithm(QCAlgorithm): def Initialize(self): self.SetStartDate(2022, 7, 1) self.SetCash(100000) self.SetBrokerageModel(MyBrokerageModel()) self.AddEquity("SPY", Resolution.Daily) def OnData(self, data: Slice): if not self.Portfolio.Invested: self.SetHoldings("SPY", 1) class MyBrokerageModel(DefaultBrokerageModel): DefaultMarkets = {SecurityType.Equity: Market.USA} RequiredFreeBuyingPowerPercent = 0 def __init__(self, accountType: AccountType = AccountType.Margin): self.AccountType = accountType def CanSubmitOrder(self, security: Security, order: Order, message: BrokerageMessageEvent) -> bool: return super().CanSubmitOrder(security, order, message) def CanUpdateOrder(self, security: Security, order: Order, request: UpdateOrderRequest, message: BrokerageMessageEvent) -> bool: return super().CanUpdateOrder(security, order, request, message) def CanExecuteOrder(self, security: Security, order: Order) -> bool: return super().CanExecuteOrder(security, order) def ApplySplit(self, tickets: List[OrderTicket], split: Split) -> None: super().ApplySplit(tickets, split) def GetLeverage(self, security: Security) -> float: return super().GetLeverage(security) def GetBenchmark(self, securities: SecurityManager) -> IBenchmark: return super().GetBenchmark(securities) def GetFillModel(self, security: Security) -> IFillModel: return super().GetFillModel(security) def GetFeeModel(self, security: Security) -> IFeeModel: return super().GetFeeModel(security) def GetSlippageModel(self, security: Security) -> ISlippageModel: return super().GetSlippageModel(security) def GetSettlementModel(self, security: Security) -> ISettlementModel: return super().GetSettlementModel(security) def GetBuyingPowerModel(self, security: Security) -> IBuyingPowerModel: return super().GetBuyingPowerModel(security) def GetMarginInterestRateModel(self, security: Security) -> IMarginInterestRateModel: return super().GetMarginInterestRateModel(security) def GetShortableProvider(self, security: Security) -> IShortableProvider: return super().GetShortableProvider(security)