Overall Statistics |
Total Trades 1666 Average Win 0.81% Average Loss -3.88% Compounding Annual Return 37.306% Drawdown 68.100% Expectancy -0.400 Net Profit 119.089% Sharpe Ratio 0.805 Probabilistic Sharpe Ratio 24.929% Loss Rate 50% Win Rate 50% Profit-Loss Ratio 0.21 Alpha 0.224 Beta 1.499 Annual Standard Deviation 0.631 Annual Variance 0.398 Information Ratio 0.561 Tracking Error 0.568 Treynor Ratio 0.339 Total Fees $3052.99 Estimated Strategy Capacity $130000000.00 Lowest Capacity Asset IPOC XFA956ZU3MUD |
class LiquidUniverseSelection(QCAlgorithm): filteredByPrice = None def Initialize(self): self.SetStartDate(2019, 1, 11) self.SetEndDate(2021, 7, 1) self.SetCash(100000) self.AddUniverse(self.CoarseSelectionFilter) self.UniverseSettings.Resolution = Resolution.Daily #1. Set the leverage to 0 self.UniverseSettings.Leverage =0 def CoarseSelectionFilter(self, coarse): sortedByDollarVolume = sorted(coarse, key=lambda c: c.DollarVolume, reverse=True) filteredByPrice = [c.Symbol for c in sortedByDollarVolume if c.Price > 10] return filteredByPrice[:10] def OnSecuritiesChanged(self, changes): self.changes = changes self.Log(f"OnSecuritiesChanged({self.Time}):: {changes}") for security in self.changes.RemovedSecurities: if security.Invested: self.Liquidate(security.Symbol) for security in self.changes.AddedSecurities: #2. Leave a cash buffer by setting the allocation to 0.18 instead of 0.2 self.SetHoldings(security.Symbol, 0.18)