Overall Statistics
Total Trades
14
Average Win
19.13%
Average Loss
-8.27%
Compounding Annual Return
13.686%
Drawdown
23.100%
Expectancy
0.325
Net Profit
6.043%
Sharpe Ratio
0.461
Probabilistic Sharpe Ratio
32.006%
Loss Rate
60%
Win Rate
40%
Profit-Loss Ratio
2.31
Alpha
0.372
Beta
0.69
Annual Standard Deviation
0.349
Annual Variance
0.122
Information Ratio
1.441
Tracking Error
0.324
Treynor Ratio
0.233
Total Fees
$163.48
Estimated Strategy Capacity
$9000000.00
Lowest Capacity Asset
X R735QTJ8XC9X
# Fundemental Data and Technical indicators

from AlgorithmImports import *

class VerticalQuantumInterceptor(QCAlgorithm):
    def Initialize(self):
        self.SetStartDate(2022, 1, 1)
        self.SetEndDate(2022, 6, 16)
        self.SetCash(100000)        
        resolution = Resolution.Daily        
        self.UniverseSettings.Resolution = resolution  
        self.AddUniverse(self.CoarseSelection, self.FineSelection)
        self.symbols = [self.AddEquity(x, resolution).Symbol
            for x in ["X", "F", "JPM"]]
        self.stocks = []
        self.macd = {}
        for sec in self.symbols:    
            self.macd[sec] = self.MACD(sec, 12, 26, 9, Resolution.Daily)

    
    def CoarseSelection(self, coarse):
        selected = [x for x in coarse if (x.HasFundamentalData) and (float(x.Price) > 10)]
        static = [x.Symbol for x in selected if (x.Symbol in self.symbols)]
        self.Plot("Universe", "static", len(static))

        return static

    
    def FineSelection(self, fine):        
        pb_ratio_filter = [x.Symbol for x in fine if x.ValuationRatios.PBRatio > 0  and (x.ValuationRatios.PBRatio < 1)]
        self.stocks = pb_ratio_filter
        self.Plot("Universe", "pb_ratio_filter", len(pb_ratio_filter))

        return self.stocks
    
    
    def OnData(self, data):
        selected = []

        for sec in self.stocks:
            if self.macd[sec].Current.Value > self.macd[sec].Signal.Current.Value:
                selected.append(sec)

        self.Plot("Universe", "macd_filter", len(selected))  

        for sec in self.Portfolio.Keys:
            if sec not in selected:
                self.Liquidate(sec)
                    
        for sec in selected:
            wt = 1.0/len(selected) if len(selected) > 0 else 0
            self.SetHoldings(sec, wt )