Overall Statistics
Total Trades
0
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.21
Tracking Error
0.284
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
# CRYPTO QC Super Trend Indicator

# -----------------------------------------------
CRYPTO = "BTCUSD"; ATR = 14; MULT = 2.0; BAR = 4;
# -----------------------------------------------

class SuperTrendIndicator(QCAlgorithm):
    
    def Initialize(self):
        self.SetStartDate(DateTime(2022, 5, 1, 9, 30, 0))  
        self.SetEndDate(DateTime(2022, 5, 27, 16, 0, 0)) 
        self.SetCash(1000000)
        res = Resolution.Hour
        self.crypto = self.AddCrypto(CRYPTO, res).Symbol
        consolidator = TradeBarConsolidator(timedelta(minutes = BAR))
        self.Consolidate(self.crypto, timedelta(minutes = BAR), self.BarHandler)
        self.st = SuperTrend(ATR, MULT, MovingAverageType.Wilders)
        self.RegisterIndicator(self.crypto, self.st, consolidator)
        self.SetWarmUp(5*BAR*ATR, res)
        
    
    def BarHandler(self, consolidated):
        if self.IsWarmingUp: return
        if not self.st.IsReady: return 

        self.Plot(CRYPTO, "Price", self.Securities[self.crypto].Price)
        self.Plot(CRYPTO, "Super Trend", self.st.Current.Value)