Overall Statistics
Total Trades
24
Average Win
0.15%
Average Loss
-0.09%
Compounding Annual Return
-2.459%
Drawdown
0.300%
Expectancy
-0.217
Net Profit
-0.082%
Sharpe Ratio
-0.71
Probabilistic Sharpe Ratio
36.174%
Loss Rate
70%
Win Rate
30%
Profit-Loss Ratio
1.61
Alpha
0.044
Beta
-0.094
Annual Standard Deviation
0.026
Annual Variance
0.001
Information Ratio
-5.364
Tracking Error
0.127
Treynor Ratio
0.195
Total Fees
$24.00
from universe_selection_model import MyUniverseModel
class TestAlgo(QCAlgorithm):

    def Initialize(self):

        self.SetStartDate(2018, 5, 28)
        self.SetEndDate(2018, 6, 9)
        self.SetWarmUp(10)
        self.SetCash(10000)
        # Universe selection settings
        self.UniverseSettings.Resolution = Resolution.Daily  
        self.UniverseSettings.DataNormalizationMode = DataNormalizationMode.Adjusted  
        self.UniverseSettings.ExtendedMarketHours = False
        self.SetUniverseSelection(MyUniverseModel())
        
    def OnSecuritiesChanged(self, changes):
        self.changes = changes
        for security in changes.RemovedSecurities:
            if security.Invested:
                self.Liquidate(security.Symbol)
        for security in changes.AddedSecurities:
            self.SetHoldings(security.Symbol, 0.1)
from Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel

class MyUniverseModel(FundamentalUniverseSelectionModel):

    def __init__(self):
        super().__init__(False)

    def SelectCoarse(self, algorithm, coarse):
        
        sortedByDollarVolume = sorted(coarse, key=lambda c: c.DollarVolume, reverse=True)
        symbols_by_price = [c.Symbol for c in sortedByDollarVolume if c.Price > 10]
        algorithm.filteredByPrice = symbols_by_price[:8]
        return algorithm.filteredByPrice

    def SelectFine(self, algorithm, fine):
        return self.symbols