Overall Statistics
Total Trades
2640
Average Win
0%
Average Loss
-0.11%
Compounding Annual Return
-100%
Drawdown
81.200%
Expectancy
-1
Net Profit
-81.078%
Sharpe Ratio
-10.587
Probabilistic Sharpe Ratio
0%
Loss Rate
100%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.942
Beta
-0.17
Annual Standard Deviation
0.094
Annual Variance
0.009
Information Ratio
-2.068
Tracking Error
0.649
Treynor Ratio
5.875
Total Fees
$154858.27
Estimated Strategy Capacity
$270000000.00
Lowest Capacity Asset
USDCUSDT 18N
# Rolling Window Fractal Indicator (Binance)

CRYPTO = "USDCUSDT";  

class BlackpantherFractal(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 4, 6)
        self.SetEndDate(2021, 4, 8) 
        self.SetCash("USDT", 100000) 
        self.crypto = self.AddCrypto(CRYPTO, Resolution.Minute, Market.Binance).Symbol
        self.SetBrokerageModel(BrokerageName.Binance, AccountType.Margin)
        self.window = RollingWindow[TradeBar](3) 
        

    def OnData(self, data):
        if not self.crypto in data.Bars: return
        self.window.Add(data.Bars[self.crypto])
        if not self.window.IsReady: return
    
        H = [self.window[i].High for i in range(3)]
        L = [self.window[i].Low for i in range(3)]
        C = [self.window[i].Close for i in range(3)]
        

        if (C[0] <= L[1] == L[2]):
            self.SetHoldings(self.crypto,1)
        elif (C[0] >= H[1] ==  H[2]):
            self.Liquidate(self.crypto)