Overall Statistics
Total Trades
11
Average Win
5.45%
Average Loss
-4.12%
Compounding Annual Return
-11.011%
Drawdown
13.400%
Expectancy
-0.070
Net Profit
-1.899%
Sharpe Ratio
-0.114
Probabilistic Sharpe Ratio
29.648%
Loss Rate
60%
Win Rate
40%
Profit-Loss Ratio
1.32
Alpha
-0.356
Beta
0.496
Annual Standard Deviation
0.307
Annual Variance
0.095
Information Ratio
-2.215
Tracking Error
0.308
Treynor Ratio
-0.07
Total Fees
$837.15
Estimated Strategy Capacity
$6000.00
Lowest Capacity Asset
AP R735QTJ8XC9X
from AlgorithmImports import *

class QuiverWikipediaDataAlgorithm(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2019, 1, 1)
        self.SetEndDate(2019, 3, 1)
        self.SetCash(100000)

        self.UniverseSettings.Resolution = Resolution.Daily

        # add a custom universe data source (defaults to usa-equity)
        self.AddUniverse(QuiverWikipediaUniverse, "QuiverWikipediaUniverse", Resolution.Daily, self.UniverseSelection)

    def OnData(self, data):
        points = data.Get(QuiverWikipedia)
        for point in points.Values:
            symbol = point.Symbol.Underlying
            
            # Buy if the company's Wikipedia page views have increased over the last week and month
            if point.MonthPercentChange > 0:
                self.SetHoldings(symbol, 1)
            
            # Sell our holdings if the company's Wikipedia page views have not increased over the last month
            else:
                self.SetHoldings(symbol, 0)

    def OnSecuritiesChanged(self, changes):
        for added in changes.AddedSecurities:
            # Requesting data
            quiver_wiki_symbol = self.AddData(QuiverWikipedia, added.Symbol).Symbol

            # Historical data
            history = self.History(QuiverWikipedia, quiver_wiki_symbol, 60, Resolution.Daily)
            self.Debug(f"We got {len(history)} items from our history request for Quiver Wikipedia data")

    def UniverseSelection(self, alt_coarse):
        for datum in alt_coarse:
            self.Log(f"{datum.Symbol},{datum.PageViews},{datum.WeekPercentChange},{datum.MonthPercentChange}")

        # define our selection criteria
        return [d.Symbol for d in alt_coarse \
                    if d.PageViews > 100 \
                    and d.WeekPercentChange < 0.2]