Overall Statistics |
Total Trades 1074 Average Win 0.06% Average Loss -0.06% Compounding Annual Return -10.837% Drawdown 5.700% Expectancy -0.183 Net Profit -2.819% Sharpe Ratio -0.928 Probabilistic Sharpe Ratio 14.363% Loss Rate 61% Win Rate 39% Profit-Loss Ratio 1.08 Alpha -0.094 Beta 0.021 Annual Standard Deviation 0.096 Annual Variance 0.009 Information Ratio -2.265 Tracking Error 0.156 Treynor Ratio -4.256 Total Fees $1208.41 Estimated Strategy Capacity $1100.00 Lowest Capacity Asset MAYS R735QTJ8XC9X |
class UglyRedOrangeChinchilla(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 12, 1) self.SetEndDate(2021, 3, 1) self.SetCash(100000) self.SetBenchmark("SPY") self.UniverseSettings.Resolution = Resolution.Daily self.AddUniverseSelection( FineFundamentalUniverseSelectionModel(self.SelectCoarse, self.SelectFine)) self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel()) self.SetExecution(ImmediateExecutionModel()) def SelectCoarse(self, coarse): hasFundamentalData = [c for c in coarse if c.HasFundamentalData] filteredByPrice = [c.Symbol for c in hasFundamentalData if c.Price > 10] return filteredByPrice def SelectFine(self, fine): sortedByPERatio = sorted(fine, key=lambda f: f.ValuationRatios.PERatio1YearHigh, reverse=False) self.forLong = [f.Symbol for f in sortedByPERatio[:10]] self.forShort = [f.Symbol for f in sortedByPERatio[-10:]] return self.forShort + self.forLong def OnData(self, slice): insights = [] [insights.append(Insight.Price(symbol, timedelta(28), InsightDirection.Up)) for symbol in self.forLong] [insights.append(Insight.Price(symbol, timedelta(28), InsightDirection.Down)) for symbol in self.forShort] self.EmitInsights(insights)