FactSet’ s Revere Business Industry Classification System (RBICS) is a comprehensive structured taxonomy designed to offer precise classification of global companies. RBICS Focus is a dataset containing single-sector mappings of thousands of the most liquid, publicly traded companies worldwide based on their primary lines of business. It uses revenues as the key factor in determining a company’s primary line of business. On Quantopian, RBICS Focus sectors are available at three levels of granularity:
RBICS Focus data is available via the Pipeline API, which means it can be accessed in Research and the IDE.
The RBICS Focus
dataset has 7 fields (accessible as BoundColumn
attributes):
l1_id
(dtype str
): Economy classification code based on business focus.l1_name
(dtype str
): Economy classification name based on business focus.l2_id
(dtype str
): Sector classification code based on business focus.l2_name
(dtype str
): Sector classification name based on business focus.l3_id
(dtype str
): Subsector classification code based on business focus.l3_name
(dtype str
): Subsector classification name based on business focus.asof_date
(dtype datetime64[ns]
): The start date (date when the record first applies) of the classification.The following cell constructs and runs a pipeline that gets the latest value for all available fields in the RBICS Focus
dataset.
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data.factset import RBICSFocus
from quantopian.pipeline.domain import US_EQUITIES
from quantopian.research import run_pipeline
pipe = Pipeline(
columns={
'l1_name': RBICSFocus.l1_name.latest,
'l2_name': RBICSFocus.l2_name.latest,
'l3_name': RBICSFocus.l3_name.latest,
'l1_id': RBICSFocus.l1_id.latest,
'l2_id': RBICSFocus.l2_id.latest,
'l3_id': RBICSFocus.l3_id.latest,
'asof_date': RBICSFocus.asof_date.latest,
},
domain=US_EQUITIES,
)
# Reminder: there is a trailing 1-year holdout on this dataset.
df = run_pipeline(pipe, '2016-05-01', '2017-05-05')
df.head()
The following cell constructs and runs a pipeline of Canadian equities that screens equities down to a tradable universe (using Equity Metadata). It then ranks equities according to their 1-week return relative to the mean return of their RBICS economy classification (level 1 classification).
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data.factset import EquityMetadata, Fundamentals, RBICSFocus
from quantopian.pipeline.factors import Returns
from quantopian.pipeline.domain import CA_EQUITIES
from quantopian.research import run_pipeline
# Create a latest market cap factor.
mcap = Fundamentals.mkt_val.latest
# Create a pipeline filter for 'tradable' stocks.
is_tradable = (
EquityMetadata.security_type.latest.eq('SHARE')
& EquityMetadata.is_primary.latest
)
# Create a base universe filter that selects the top 50% of our 'tradable'
# equities based on market cap.
base_universe = mcap.percentile_between(50, 100, mask=is_tradable)
# RBICS 'economy' classification.
rbics_economy = RBICSFocus.l1_name.latest
# 1-week returns factor.
returns_1w = Returns(window_length=6)
# 1-week returns minus the economy mean 1-week return.
returns_less_economy_mean = returns_1w.demean(groupby=rbics_economy, mask=base_universe)
# Build a pipeline over the Canadian equities domain and screen down to
# a set of stocks that pass our base_universe filter.
pipe = Pipeline(
columns={
'rbics_economy': rbics_economy,
'returns_1w': returns_1w,
'returns_less_economy_mean': returns_less_economy_mean,
# Adding this column to display the economy mean return.
'economy_mean_return_1w': returns_1w - returns_less_economy_mean,
},
domain=CA_EQUITIES,
screen=base_universe,
)
df = run_pipeline(pipe, '2015-05-05', '2017-05-05')
df.head()
Economy (level 1) labels in the QTradableStocksUS (US-only):
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data.factset import RBICSFocus
from quantopian.pipeline.domain import US_EQUITIES
from quantopian.pipeline.filters import QTradableStocksUS
from quantopian.research import run_pipeline
pipe = Pipeline(
columns={
'l1_name': RBICSFocus.l1_name.latest,
'l2_name': RBICSFocus.l2_name.latest,
'l3_name': RBICSFocus.l3_name.latest,
},
domain=US_EQUITIES,
screen=QTradableStocksUS(),
)
df = run_pipeline(pipe, '2015-05-05', '2017-05-05')
df.head()
import numpy as np
economy_counts = df.loc[('2017-01-05', slice(None)), :].groupby('l1_name').size().drop(np.nan)
print 'Number of RBICS economy labels in the QTU on 01/05/2017:'
print len(economy_counts)
print ''
print 'RBICS economy label frequencies in the QTU on 01/05/2017:'
economy_counts.sort_values(ascending=False)
sector_counts = df.loc[('2017-01-05', slice(None)), :].groupby('l2_name').size().drop(np.nan)
print 'Number of RBICS sector labels in the QTU on 01/05/2017:'
print len(sector_counts)
print ''
print 'RBICS sector label frequencies in the QTU on 01/05/2017:'
sector_counts.sort_values(ascending=False)
subsector_counts = df.loc[('2017-01-05', slice(None)), :].groupby('l3_name').size().drop(np.nan)
print 'Number of RBICS subsector labels in the QTU on 01/05/2017:'
print len(subsector_counts)
print ''
print 'RBICS subsector label frequencies in the QTU on 01/05/2017:'
subsector_counts.sort_values(ascending=False)
RBICS Focus data is available in pipelines in the IDE (US_EQUITIES
domain only) as well as being available in Research. Therefore, algorithms that use RBICS Focus data are eligible for the contest and will be considered for an allocation.
The RBICS Focus dataset can be used in many situations like constructing a tradable universe, segmenting a universe, or even creating sector-specific factors. The dataset covers all global equities supported on Quantopian. Try exploring the data and see if you can come up with ideas to include it in existing strategies or new strategies altogether!