Overall Statistics
Total Trades
4254
Average Win
0%
Average Loss
-0.13%
Compounding Annual Return
-100%
Drawdown
94.900%
Expectancy
-1
Net Profit
-94.692%
Sharpe Ratio
-3.661
Probabilistic Sharpe Ratio
0.458%
Loss Rate
100%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.501
Beta
0.699
Annual Standard Deviation
0.273
Annual Variance
0.075
Information Ratio
-1.541
Tracking Error
0.185
Treynor Ratio
-1.432
Total Fees
$91183.62
Estimated Strategy Capacity
$6000.00
Lowest Capacity Asset
USDCUSDT 18N
# Rolling Window Fractal Indicator (Binance)

CRYPTO = "USDCUSDT";  

class BlackpantherFractal(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 4, 1)
        self.SetEndDate(2021, 4, 5) 
        self.SetCash("USDT", 1000) 
        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)]
        curr_price = self.Securities[self.crypto].Price
        

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