QuantRocket logo
Disclaimer


Fundamental Factors › Lesson 3: Basic Usage


Basic Usage¶

Choosing a dimension¶

The first step when using Sharadar fundamentals is to decide which "dimension" you want to use. There are 6 possible dimensions, resulting from the combination of 3 possible reporting windows and 2 ways of handling restatements. The 3 reporting windows are:

  • Q = Quarterly: metrics reflect financial results for the fiscal quarter
  • Y = Annual: metrics reflect financial results for the fiscal year
  • T = Trailing-Twelve Month: metrics reflect financial results for the trailing twelve months (previous 4 quarters)

The 2 ways of handling restatements are:

  • AR = As-Reported: metrics reflect the values as originally reported by the company
  • MR = Most Recently Reported: metrics reflect the most recently reported values

For historical research, most quants prefer to use As-Reported data, because it most accurately represents what would have originally been known at the time of trade.

Thus the 6 possible dimensions are:

  • ARQ = As-Reported Quarterly
  • ARY = As-Reported Annual
  • ART = As-Reported Trailing-Twelve Month
  • MRQ = Most Recently Reported Quarterly
  • MRY = Most Recently Reported Annual
  • MRT = Most Recently Reported Trailing-Twelve Month

In this notebook, we will use as-reported, trailing-twelve-month fundamentals. To do so, we use the slice() method of zipline.pipeline.sharadar.Fundamentals to select the desired dimension. Fundamentals is a DataSetFamily, and calling its slice() method returns a DataSet:

In [1]:
from zipline.pipeline import sharadar

fundamentals = sharadar.Fundamentals.slice('ART')

Using Columns as Factors¶

Many fundamental factors are directly available as columns in the Sharadar dataset. A list of available factors can be found in the docstring for Fundamentals, which can be viewed by clicking on Fundamentals in the above cell in JupyterLab and pressing Ctrl. Once you have identified a factor of interest, you can use it in Pipeline by accessing its latest property.

If we want to look at profitability, one metric we could use is net margin, defined as the ratio of net income to revenue:

In [2]:
net_margin = fundamentals.NETMARGIN.latest

Deriving Factors from Multiple Columns¶

Sometimes, a fundamental metric may not be directly available in the dataset, but you can derive the metric by combining other metrics. For example, operating margin, defined as the ratio of operating income to revenue, is not included in the dataset. But you can derive the metric like this:

In [3]:
operating_margin = fundamentals.OPINC.latest / fundamentals.REVENUE.latest

Next Up¶

Lesson 4: Periodic Computations