Quiver Quantitative

Wikipedia Page Views

Introduction

The Wikipedia Page Views dataset by Quiver Quantitative tracks Wikipedia page views for US Equities. The data covers 1,300 US Equities, starts in October 2016, and is delivered on a daily frequency. This dataset is created by scraping the Wikipedia pages of companies.

This dataset depends on the US Equity Security Master dataset because the US Equity Security Master dataset contains information on splits, dividends, and symbol changes.

For more information about the Wikipedia Page Views dataset, including CLI commands and pricing, see the dataset listing.

About the Provider

Quiver Quantitative was founded by two college students in February 2020 with the goal of bridging the information gap between Wall Street and non-professional investors. Quiver allows retail investors to tap into the power of big data and have access to actionable, easy to interpret data that hasn’t already been dissected by Wall Street.

Getting Started

The following snippet demonstrates how to request data from the Wikipedia Page Views dataset:

self.symbol = self.AddEquity("AAPL", Resolution.Daily).Symbol
self.dataset_symbol = self.AddData(QuiverWikipedia, self.symbol).Symbol

self.AddUniverse(QuiverWikipediaUniverse, "QuiverWikipediaUniverse", Resolution.Daily, self.UniverseSelectionMethod)
_symbol = AddEquity("AAPL", Resolution.Daily).Symbol;
_datasetSymbol = AddData<QuiverWikipedia>(_symbol).Symbol;

AddUniverse<QuiverWikipediaUniverse>("QuiverWikipediaUniverse", Resolution.Daily, UniverseSelectionMethod);

Data Summary

The following table describes the dataset properties:

PropertyValue
Start DateOctober 2016
Asset Coverage1,300 US Equities
Data DensitySparse
ResolutionDaily
TimezoneUTC

Data Point Attributes

The Wikipedia Page Views dataset provides QuiverWikipedia and QuiverWikipediaUniverse objects.

QuiverWikipedia Attributes

QuiverWikipedia objects have the following attributes:

QuiverWikipediaUniverse Attributes

QuiverWikipediaUniverse objects have the following attributes:

Requesting Data

To add Wikipedia Page Views data to your algorithm, call the AddData method. Save a reference to the dataset Symbol so you can access the data later in your algorithm.

class QuiverWikipediaPageViewsDataAlgorithm(QCAlgorithm):
    def Initialize(self) -> None:
        self.SetStartDate(2019, 1, 1)
        self.SetEndDate(2020, 6, 1)
        self.SetCash(100000)

        self.symbol = self.AddEquity("AAPL", Resolution.Daily).Symbol
        self.dataset_symbol = self.AddData(QuiverWikipedia, self.symbol).Symbol
namespace QuantConnect
{
    public class QuiverWikipediaPageViewsDataAlgorithm : QCAlgorithm
    {
        private Symbol _symbol, _datasetSymbol;

        public override void Initialize()
        {
            SetStartDate(2019, 1, 1);
            SetEndDate(2020, 6, 1);
            SetCash(100000);
            _symbol = AddEquity("AAPL", Resolution.Daily).Symbol;
            _datasetSymbol = AddData<QuiverWikipedia>(_symbol).Symbol;
        }
    }
}

Accessing Data

To get the current Wikipedia Page Views data, index the current Slice with the dataset Symbol. Slice objects deliver unique events to your algorithm as they happen, but the Slice may not contain data for your dataset at every time step. To avoid issues, check if the Slice contains the data you want before you index it.

def OnData(self, slice: Slice) -> None:
    if slice.ContainsKey(self.dataset_symbol):
        data_point = slice[self.dataset_symbol]
        self.Log(f"{self.dataset_symbol} weekly page views percentage change at {slice.Time}: {data_point.WeekPercentChange}")
public override void OnData(Slice slice)
{
    if (slice.ContainsKey(_datasetSymbol))
    {
        var dataPoint = slice[_datasetSymbol];
        Log($"{_datasetSymbol} weekly page views percentage change at {slice.Time}: {dataPoint.WeekPercentChange}");
    }
}

To iterate through all of the dataset objects in the current Slice, call the Get method.

def OnData(self, slice: Slice) -> None:
    for dataset_symbol, data_point in slice.Get(QuiverWikipedia).items():
        self.Log(f"{dataset_symbol} weekly page views percentage change at {slice.Time}: {data_point.WeekPercentChange}")
public override void OnData(Slice slice)
{
    foreach (var kvp in slice.Get<QuiverWikipedia>())
    {
        var datasetSymbol = kvp.Key;
        var dataPoint = kvp.Value;
        Log($"{datasetSymbol} weekly page views percentage change at {slice.Time}: {dataPoint.WeekPercentChange}");
    }
}

Historical Data

To get historical Wikipedia Page Views data, call the History method with the dataset Symbol. If there is no data in the period you request, the history result is empty.

# DataFrame
history_df = self.History(self.dataset_symbol, 100, Resolution.Daily)

# Dataset objects
history_bars = self.History[QuiverWikipedia](self.dataset_symbol, 100, Resolution.Daily)
var history = History<QuiverWikipedia>(_datasetSymbol, 100, Resolution.Daily);

For more information about historical data, see History Requests.

Universe Selection

To select a dynamic universe of US Equities based on Wikipedia Page Views data, call the AddUniverse method with the QuiverWikipediaUniverse class and a selection function.

def Initialize(self) -> None:
    self.AddUniverse(QuiverWikipediaUniverse, "QuiverWikipediaUniverse", Resolution.Daily, self.UniverseSelection)

def UniverseSelection(self, alt_coarse: List[QuiverWikipediaUniverse]) -> List[Symbol]:
    return [d.Symbol for d in alt_coarse \
                if d.PageViews > 100 \
                and d.WeekPercentChange < 0.2]
public override void Initialize()
{
    AddUniverse<QuiverWikipediaUniverse>("QuiverWikipediaUniverse", Resolution.Daily, altCoarse =>
    {
        return from d in altCoarse
                where d.PageViews > 100m && d.MonthPercentChange > 0.2m
                select d.Symbol;
    });
}

For more information about dynamic universes, see Universes.

Remove Subscriptions

To remove a subscription, call the RemoveSecurity method.

self.RemoveSecurity(self.dataset_symbol)
RemoveSecurity(_datasetSymbol);

If you subscribe to Wikipedia Page Views data for assets in a dynamic universe, remove the dataset subscription when the asset leaves your universe. To view a common design pattern, see Track Security Changes.

Example Applications

The Wikipedia Page Views dataset enables you to observe patterns in the traffic of company Wikipedia pages. Examples include the following strategies:

  • Capitalizing on companies that have experienced a sharp increase in Wikipedia traffic on the premise that volatility in traffic will translate to volatility in price
  • Mitigating risk by avoiding companies that have a decreasing web presence on the premise that a reduction in traffic will result in a reduction in price

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: