Overall Statistics |
Total Trades 51 Average Win 0.83% Average Loss -0.62% Compounding Annual Return 6.123% Drawdown 4.000% Expectancy 0.396 Net Profit 6.275% Sharpe Ratio 1.093 Probabilistic Sharpe Ratio 52.305% Loss Rate 40% Win Rate 60% Profit-Loss Ratio 1.33 Alpha -0.047 Beta 0.267 Annual Standard Deviation 0.058 Annual Variance 0.003 Information Ratio -2.721 Tracking Error 0.129 Treynor Ratio 0.237 Total Fees $51.00 Estimated Strategy Capacity $310000000.00 Lowest Capacity Asset SPY R735QTJ8XC9X |
class BasicTemplateAlgorithm(QCAlgorithm): def Initialize(self): self.SetStartDate(2020,6,1) self.SetCash(4000) self.Equities = ["SPY","AMC","GME","SENS","AMSC","SNDL","HARP","EH","LOOP","QFIB","IDT", "BB","BTX","RCON","BGFV","SBOW","EDRY","BBW","CELH","DDS","RRD", "NOTV","UAN","JYNT","RFP","LOVE","NTP","RICK","SI","CMBM","CTRN", "BNTX","TGLS","TGB","HYRE","BCRX","AVID","BBIG","WINT","DOCU"] self.SetWarmUp(30) for stock in self.Equities: self.AddEquity(stock, Resolution.Hour).Symbol self.rsi = self.RSI(stock, 14, Resolution.Daily) self.macd = self.MACD(stock, 12, 26, 9, Resolution.Daily) self.Schedule.On(self.DateRules.EveryDay(self.Equities[0]), self.TimeRules.AfterMarketOpen(self.Equities[0], 31), self.EveryDayAfterMarketOpen) def EveryDayAfterMarketOpen(self): if self.IsWarmingUp: return for sec in self.Equities: Vested = self.Portfolio.Invested Aveprica = self.Portfolio[sec].AveragePrice Nowprica = self.Portfolio[sec].Price Quantity = self.Portfolio[sec].Quantity Bpower = self.Portfolio.Cash Rsi = self.rsi.Current.Value Macd =self.macd.Current.Value #The perfect Swing set up is Adx > 20 and Rsi > 60 and Macd > 0 and Cci > 100: if not Vested and Bpower > Nowprica and Rsi > 60 and Macd > 0: self.MarketOrder(sec, 5) # self.Log(Aveprica) elif Vested and Rsi < 30 and Macd < 0: self.SetHoldings(sec, 0) else: pass