Overall Statistics |
Total Trades 152 Average Win 0.62% Average Loss -0.42% Compounding Annual Return 6.780% Drawdown 5.400% Expectancy 0.208 Net Profit 12.757% Sharpe Ratio 0.76 Probabilistic Sharpe Ratio 33.668% Loss Rate 51% Win Rate 49% Profit-Loss Ratio 1.47 Alpha 0.047 Beta 0.121 Annual Standard Deviation 0.064 Annual Variance 0.004 Information Ratio 0.261 Tracking Error 0.134 Treynor Ratio 0.401 Total Fees $465.18 Estimated Strategy Capacity $120000000.00 Lowest Capacity Asset XLV RGRPZX100F39 Portfolio Turnover 15.46% |
# region imports from AlgorithmImports import * # endregion class HipsterFluorescentPinkMule(QCAlgorithm): def Initialize(self): self.SetStartDate(2021, 9, 1) # Set Start Date self.SetEndDate(2023, 7, 1) self.SetCash(100000) # Set Strategy Cash self.symbol = self.AddEquity("XLV", Resolution.Daily).Symbol self.Settings.FreePortfolioValuePercentage = 0.25 self.dataset_symbol = self.AddData(RegalyticsRegulatoryArticles, "REG").Symbol self.SetBenchmark(self.symbol) def OnData(self, slice: Slice) -> None: # Parse articles if not slice.ContainsKey(self.dataset_symbol): return fda_news = False articles = slice[self.dataset_symbol] for article in articles: if "FDA" in article.Title: fda_news = True self.last_fda_news = self.Time if fda_news and not self.Portfolio[self.symbol].IsLong: self.SetHoldings(self.symbol, 1) elif not fda_news and not self.Portfolio[self.symbol].IsShort: self.SetHoldings(self.symbol, -0.25)