Tag switch

The tag switch signal can be used in cases where you have a collection of underlying signals, and you want to create a new signal which selects different underlying signals depending on the entity being evaluated.

This can, for example, be used if you have two vendors for data about American and European companies and you want to combine these into a single signal.

tag_switch(signals: Mapping[str, Signal], default_signal: Signal = None)
Params signals

a dictionary with tag ids as strings and signals as values; the tags are traversed in order, and the signal evaluated for a given entity is the signal corresponding to the first tag that matched the entity

Params default_signal

optionally, a signal which should be evaluated if no tag matches an entity


tag_switch({'graph:tag:exchange:primary:xlon': signal_1, 'graph:tag:exchange:primary:xnas': signal_2}, signal_3)