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 inset_1
that are not part ofset_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)