Companies, entities and tags

A signal is normally evaluated for one or more entities. These entities are typically dynamic and given as input to the signal evaluation as a list of companies, entities or tags. However, in some cases you may want a signal evaluated for a fixed set of entities, ignoring the evaluation entities. The company(), entity() and tag() functions can be used for exactly this.

company(company_id, signal, errors_as_warnings=False)

Evaluate a signal for the given company or companies.

Parameters:
  • company_id (str|List[str]) – One or more company identifiers. Each company identifier can be given as a Bloomberg ticker, ISIN, FactSet identifier, Exabel resource name or company name. It is recommended to use one of the specific identifiers instead of company name, as company name matching fails if multiple companies match the given name.

  • signal (Signal) – Signal to evaluate.

  • errors_as_warnings (bool) – Whether to convert errors for the underlying companies to warnings.

entity(entity_id, signal, errors_as_warnings=False)

Evaluate a signal for the given entity or entities.

Parameters:
  • entity_id (str|List[str]) – One or more entity identifiers. Each entity identifier must be specified as an Exabel resource name.

  • signal (Signal) – Signal to evaluate.

  • errors_as_warnings (bool) – Whether to convert errors for the underlying entities to warnings.

tag(tag_id, signal, errors_as_warnings=False)

Evaluate a signal for all entities in the given tag or screen. If a screen is specified, the screen is resolved for the current date.

Parameters:
  • tag_id (str) – Tag or screen resource name.

  • signal (Signal) – Signal to evaluate.

  • errors_as_warnings (bool) – Whether to convert errors for the underlying entities to warnings.

Exabel resource names for companies, entities and tags may be found in the user interface wherever a company / entity / tag has been selected, for example in Signal Explorer, by clicking on the company / entity / tag, and copying its “Exabel name”. Alternatively, they are also retrievable from the API - use the Data API to list and search for companies and entities, and the Analytics API to list tags.

Entity set operations

company(), entity() and tag() allows specifying a single company, entity or tag (company() and entity() also supports multiple identifiers as a union). In addition, the functions union(), intersection() and subtract() can be used to create new sets of entities combining companies, entities and tags. Each of these functions return an EntitySet such that they can be nested. The input arguments to these functions are either an EntitySet or a company, entity or tag identifier. Supported identifiers are:

  • Tag: resource name.

  • Entity: resource name.

  • Company: Bloomberg ticker, ISIN, FactSet identifier, Exabel resource name, or company name.

For companies it is recommended to use one of the specific identifiers instead of company name, as company name matching fails if multiple companies match the given name.

To retrieve a signal for an EntitySet use entity_set.retrieve(signal).

union(set_1, set_2, ..., set_n)

Return an EntitySet which is the union of the given sets.

Parameters:

set_x (str|EntitySet) – An identifier for a tag, entity or company, or another EntitySet.

intersection(set_1, set_2, ..., set_n)

Return an EntitySet which is the intersection of the given sets.

Parameters:

set_x (str|EntitySet) – An identifier for a tag, entity or company, or another EntitySet.

subtract(set_1, set_2)

Return an EntitySet which contains all the entities in set_1 that are not part of set_2.

Parameters:
  • set_1 (str|EntitySet) – An identifier for a tag, entity or company, or another EntitySet.

  • set_2 (str|EntitySet) – An identifier for a tag, entity or company, or another EntitySet.

Examples

A signal that returns close price for Apple, Inc:

company('AAPL US', close_price)

A signal that returns the sum of close prices for Microsoft Corp. and Apple, Inc:

company(['MSFT US', 'AAPL US'], close_price).sum()

A signal that returns my_signal for a given brand:

entity("entityTypes/ns.brand/entities/ns.brand1", my_signal)

A signal that returns close prices for all companies at the Oslo Stock Exchange:

tag("tags/exchange:xosl", close_price)

A signal that returns the sum of close prices for all companies in the given screen:

tag("screens/123", close_price).sum()

A signal that returns close prices for all companies on the London stock exchange within the Footwear Retail RBICS level 4 sector:

intersection('tags/exchange:xlon', 'tags/rbics:20251025').retrieve(close_price)

A signal that returns close prices for all companies on the London stock exchange within the Footwear Retail RBICS level 4 sector, except Dr. Martens Plc:

subtract(intersection('tags/exchange:xlon', 'tags/rbics:20251025'), 'DOCS LN').retrieve(close_price)

Screen signal

The ‘screen’ signal indicates when entities are part of a given screen or not. The signal value is 1 when the entity is part of the screen, and 0, NaN or some other chosen value when it’s not.

This signal can be used to create an alpha signal from a screen.

Another use case is to only include signal values when the entity is part of the screen. This is achieved by setting NaN when the entity isn’t part of the screen, and then multiplying the original signal by this signal. This can be used when doing cross-sectional normalizing of a signal, to ensure that the signal is only normalized over the entities in the screen.

screen(tag, screen_frequency='M', fill_value=0.0)

Evaluates the screen with the given frequency. One time series is produced for each evaluation entity (typically company). In each time series, there is a value for each date that the screen was evaluated for. The value is 1.0 if the company is part of the screen, and 0.0 if not (or some other specified fill_value).

Parameters:
  • tag – The tag ID of the screen.

  • screen_frequency – The frequency with which to evaluate the screen.

  • fill_value – The value to use when entities are not part of the screen, or None.

Examples

An alpha signal that is 1 when a company is part of the screen, and 0 if not, evaluated at month end:

screen("screens/123")

An alpha signal that is 1 when a company is part of the screen, and -1 if not, evaluated weekly on Wednesdays:

screen("screens/123", "W-WED", -1)

Apply cross-sectional normalization of a signal across each sector, but only across the companies that are part of the screen:

(mySignal * screen("screens/123", "MS", None).upsample()).sector_neutral(level=2)