Overall Statistics |
Total Trades 3 Average Win 0% Average Loss -0.43% Compounding Annual Return -11.252% Drawdown 0.600% Expectancy -1 Net Profit -0.294% Sharpe Ratio -2.813 Probabilistic Sharpe Ratio 23.439% Loss Rate 100% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.094 Beta -0.013 Annual Standard Deviation 0.031 Annual Variance 0.001 Information Ratio 1.041 Tracking Error 0.38 Treynor Ratio 6.853 Total Fees $3.00 |
class VentralResistanceAutosequencers(QCAlgorithm): def Initialize(self): self.SetStartDate(2020,6,10) # Set Start Date self.SetEndDate(2020,6,18) self.spy = self.AddEquity("SPY", Resolution.Daily) self.SetCash(250000) # Set Strategy Cash self.sma_high = self.SMA("SPY", 8, Resolution.Daily, Field.High) self.sma_low = self.SMA("SPY", 8, Resolution.Daily, Field.Low) self.window = RollingWindow[TradeBar](2) self.sma_high.Updated += self.SmaUpdated self.smaWin = RollingWindow[IndicatorDataPoint](2) self.sma_low.Updated += self.SmaUpdated_low self.smaWinn = RollingWindow[IndicatorDataPoint](2) def SmaUpdated(self, sender, updated): self.smaWin.Add(updated) def SmaUpdated_low(self, sender, updated): self.smaWinn.Add(updated) def OnData(self, data): if self.IsWarmingUp: return self.window.Add(data["SPY"]) if not (self.window.IsReady and self.smaWin.IsReady): return if (not self.Portfolio.Invested) : self.MarketOrder("SPY",100) Open = self.Securities["SPY"].Open self.StopMarketOrder("SPY",-100, Open* 0.95) if (self.Portfolio.Invested): self.Debug("Total unrealized profit: " + str(self.Portfolio.TotalUnrealizedProfit)+ "this is the spy sma 8 high " + str(self.smaWin[0].Value)) def OnOrderEvent(self, orderEvent): if orderEvent.Status == OrderStatus.Filled: self.lastOrderEvent = orderEvent self.Debug("this is the order event"+str(orderEvent.OrderId))