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
1.498
Tracking Error
0.166
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
class HyperActiveMagentaAlligator(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 12, 26)  # Set Start Date
        self.SetEndDate(2022,2,26)
        self.SetCash(100000)  # Set Strategy Cash
        # self.AddEquity("SPY", Resolution.Minute)
        self.spy = self.AddEquity("SPY",Resolution.Minute)
        self.bias = self.EMA("SPY", 10, Resolution.Daily)
        self.confirmation = self.EMA("SPY", 10, Resolution.Hour)
        self.pullback = self.RSI("SPY", 14, resolution=Resolution.Hour)
        self.timing = self.RSI("SPY", 14, resolution=Resolution.Minute)
        
        
        
        
        


    def OnData(self, data):
        
        if not self.bias.IsReady or not self.confirmation.IsReady or not self.pullback.IsReady or not self.timing.IsReady:
            return
        
        if not self.Portfolio.Invested:
            if data["SPY"].Close > self.bias.Current.Value:
                self.Debug("data[SPY].Close > self.bias.Current.Value")
                if data["SPY"].Close > self.confirmation.Current.Value:
                    self.Debug("data[SPY].Close > self.confirmation.Current.Value")
                    if self.pullback.Current.Value < 30:
                        self.Debug("self.pullback.Current.Value < 30")
                        if self.timing.Current.Value > 50:
                            self.Debug("self.timing.Current.Value > 50")
                            self.SetHoldings("SPY", 1)
            if data["SPY"].Close < self.bias.Current.Value:
                self.Debug("data[SPY].Close < self.bias.Current.Value")
                if data["SPY"].Close < self.confirmation.Current.Value:
                    self.Debug("data[SPY].Close < self.confirmation.Current.Value")
                    if self.pullback.Current.Value > 80:
                        self.Debug("self.pullback.Current.Value > 80")
                        if self.timing.Current.Value < 50:
                            self.Debug("self.timing.Current.Value < 50")
                            self.SetHoldings("SPY", -1)
        else:
            if self.Portfolio["SPY"].IsLong:
                if self.timing.Current.Value < 30:
                    self.Liquidate("SPY")
            elif self.Portfolio["SPY"].IsShort:
                if self.timing.Current.Value > 80:
                    self.Liquidate("SPY")