Overall Statistics |
Total Trades 7859 Average Win 0.29% Average Loss -0.31% Compounding Annual Return -16.932% Drawdown 52.900% Expectancy -0.014 Net Profit -25.111% Sharpe Ratio -0.106 Probabilistic Sharpe Ratio 6.482% Loss Rate 49% Win Rate 51% Profit-Loss Ratio 0.93 Alpha 0.002 Beta -0.223 Annual Standard Deviation 0.458 Annual Variance 0.21 Information Ratio -0.499 Tracking Error 0.551 Treynor Ratio 0.217 Total Fees $8190.94 Estimated Strategy Capacity $360000000.00 Lowest Capacity Asset ALXN R735QTJ8XC9X |
class MeanReversionAlgo(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 1, 1) # Set Start Date self.SetCash(100000) self.AddEquity("SPY", Resolution.Daily) self.AddUniverse(self.CoarseSelectionFunction) self.UniverseSettings.Resolution = Resolution.Daily def CoarseSelectionFunction(self, coarse): filtered = [x for x in coarse if x.HasFundamentalData and x.Price > 5] sort_ = sorted(filtered, key=lambda x: x.DollarVolume, reverse=True) self.selections = [x.Symbol for x in sort_[:10]] return self.selections def OnData(self, data): [self.SetHoldings(symbol, 0) for symbol in self.Portfolio.Keys if self.Portfolio[symbol].Invested] [self.SetHoldings(symbol, 0.1) for symbol in self.selections]