Overall Statistics
Total Trades
115
Average Win
0.07%
Average Loss
0.00%
Compounding Annual Return
88.771%
Drawdown
6.500%
Expectancy
226.331
Net Profit
33.960%
Sharpe Ratio
4.183
Probabilistic Sharpe Ratio
93.883%
Loss Rate
7%
Win Rate
93%
Profit-Loss Ratio
243.38
Alpha
0.543
Beta
0.691
Annual Standard Deviation
0.173
Annual Variance
0.03
Information Ratio
2.976
Tracking Error
0.155
Treynor Ratio
1.049
Total Fees
$133.21
Estimated Strategy Capacity
$5600000.00
Lowest Capacity Asset
WGP VC8EGN8O5EG5
class SquareBrownScorpion(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 1, 1)
        self.SetCash(100000) 
        
        self.SetBenchmark("SPY")
        
        self.AddUniverseSelection(FineFundamentalUniverseSelectionModel(self.SelectCoarse, self.SelectFine))
        # self.AddAlpha( MyAlphaModel() )
        self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel(lambda time: Expiry.EndOfMonth(time)))
        self.AddRiskManagement( NullRiskManagementModel() )
        self.SetExecution( ImmediateExecutionModel() ) 
        
        self.next = self.Time
    
    
    def SelectCoarse(self, coarse):
        if self.next >= self.Time:
            return Universe.Unchanged
            
        sorted_by_dollarvolume = sorted(coarse, key=lambda x: x.DollarVolume, reverse=True)
        return [x.Symbol for x in coarse if x.DollarVolume > 20000000 and x.HasFundamentalData]
    
    
    def SelectFine(self, fine):
        if self.next >= self.Time:
            return Universe.Unchanged
            
        sorted_by_dividend = sorted(fine, key=lambda c: c.ValuationRatios.DivYield5Year, reverse=True)
        return [c.Symbol for c in sorted_by_dividend if c.MarketCap > 5000000000][:20]    
        
        
    def OnData(self, data):
        insights = []
        
        if self.next >= self.Time:
            return
        
        for security in self.ActiveSecurities.Values:
            insights.append(Insight.Price(security.Symbol, Expiry.EndOfMonth, InsightDirection.Up)) 
        
        self.EmitInsights(insights)
        
        self.next = Expiry.EndOfMonth(self.Time)