Overall Statistics |
Total Trades 4 Average Win 0% Average Loss -0.71% Compounding Annual Return -2.856% Drawdown 1.400% Expectancy -1 Net Profit -1.426% Sharpe Ratio -1.786 Probabilistic Sharpe Ratio 0.000% Loss Rate 100% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.023 Beta -0.001 Annual Standard Deviation 0.013 Annual Variance 0 Information Ratio -0.21 Tracking Error 0.416 Treynor Ratio 30.934 Total Fees $4.00 |
class OptimizedVerticalCoreWave(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 1, 12) # Set Start Date self.SetCash(100000) # Set Strategy Cash for ticker in ['SPY', 'TSLA']: self.AddEquity(ticker, Resolution.Daily) #self.order_ticket = None self.liquidated = False def OnData(self, data): if not self.Portfolio.Invested and not self.liquidated: self.SetHoldings("SPY", 0.5) self.SetHoldings("TSLA", 0.5) self.spy_order_ticket = self.StopMarketOrder("SPY", -10, 200) self.tsla_order_ticket = self.StopMarketOrder("TSLA", -10, 100) else: if self.liquidated: return self.liquidated = True self.SetHoldings("SPY", 0) self.Liquidate("TSLA") self.Log(f"SPY order submitted: {self.spy_order_ticket.Status == OrderStatus.Submitted}") self.Log(f"TSLA order cancelled: {self.tsla_order_ticket.Status == OrderStatus.Canceled}")