Overall Statistics
Total Trades
15
Average Win
2.30%
Average Loss
-23.47%
Compounding Annual Return
-87.848%
Drawdown
79.600%
Expectancy
-0.634
Net Profit
-64.964%
Sharpe Ratio
-0.852
Probabilistic Sharpe Ratio
1.626%
Loss Rate
67%
Win Rate
33%
Profit-Loss Ratio
0.10
Alpha
0
Beta
0
Annual Standard Deviation
0.942
Annual Variance
0.887
Information Ratio
-0.852
Tracking Error
0.942
Treynor Ratio
0
Total Fees
$15.00
Estimated Strategy Capacity
$5900000.00
Lowest Capacity Asset
GME SC72NCBXXAHX
class ShortAvailabilityDataAlgorithm(QCAlgorithm):

    def Initialize(self):
        
        self.SetStartDate(2021, 1, 1)
        self.SetEndDate(2021, 7, 1)
        self.SetCash(1000)
        self.SetBrokerageModel(InteractiveBrokersBrokerageModelWithShortable())
        self.equity = self.AddEquity("GME")
            
        self.Schedule.On(
            self.DateRules.EveryDay(self.equity.Symbol),
            self.TimeRules.AfterMarketOpen(self.equity.Symbol, 10),
            self.Rebalance)

    def Rebalance(self):
        symbol = self.equity.Symbol;

        self.Plot('Total Shortable Quantity', symbol, self.equity.TotalShortableQuantity)
            
        # First, let's not rebalance if there are no shares to short
        if self.ShortableQuantity(symbol) < 0: return
            
        # Then, test whether we can short the desired quantity
        quantity = self.CalculateOrderQuantity(symbol, -1)
        if self.Shortable(symbol, quantity):
            self.MarketOrder(symbol, quantity)
           
    def OnMarginCallWarning(self):
        self.Liquidate()
 
class InteractiveBrokersBrokerageModelWithShortable(InteractiveBrokersBrokerageModel):
    def __init__(self):
        super().__init__()
        self.ShortableProvider = AtreyuShortableProvider(SecurityType.Equity, Market.USA)