Custom data sources

This page introduces the concept of custom data sources and explores the ways in which they can be defined and utilised on the SigTech platform. It shows you how to:

  • Construct your environment

  • Query available data sources

  • Set a data source

  • Compare data sources

Environment

import sigtech.framework as sig
sig.de_init()
sig.init()

During the configuration of your research environment, a range of parameters can be used to set and define its features and behaviour.

The following command lists the first ten environment configuration parameters:

sorted(sig.env().config)[:10]

Learn more: on configuration parameters, see Environment setup.

Custom data sources can be set by assigning values to the CUSTOM_DATA_SOURCE_CONFIG parameter.

sig.config.CUSTOM_DATA_SOURCE_CONFIG

No custom data sources are set by default. This can be confirmed by running the following command:

sig.env()[sig.config.CUSTOM_DATA_SOURCE_CONFIG]

View available sources

Whilst custom data sources can be specified for any type of tradable instrument, our example uses FX spot data to demonstrate this functionality.

The following command retrieves an FX pair:

fx = sig.obj.get('EURUSD CURNCY')

To determine the default data source for this instrument:

fx_data_source

To list the data sources available for an instrument, use data_source_all. The results generated by this command will depend on your current data entitlements. To access additional data, please contact our sales team at sales@sigtech.com.

fx.data_source_all

Change source

Before resetting the data source it is necessary to de-initialize and re-initialize the environment:

sig.de_init()
sig.init()

The following code block selects objects whose internal id is of the form '[A-Z]{6} CURNCY' and changes their data source to 'REFINITIV':

sig.env()[sig.config.CUSTOM_DATA_SOURCE_CONFIG] = [
        ('[A-Z]{6} CURNCY', 'REFINITIV'),
    ]

To confirm this change, retrieve the FX pair and querying its data source:

fx_refinitiv = sig.obj.get('EURUSD CURNCY')
fx_refinitiv.data_source

To display the group to which the object belongs, use the following command:

fx.refinitiv.group()

To tabulate the first five available data points within the instrument’s history, use both the history() and head() functions:

fx_refinitiv.history().head()

We can also compare currencies available from different data sources:

sig.FXFixGroup.get_names()

To view currencies available from Refinitiv but unavailable from ICE:

ice_ccys = sig.obj.get('ICE TERMSTRUCTURE FXFIX GROUP').query_instrument_names()
refinitiv_ccys = sig.obj.get('REFINITIV FXFIX GROUP').query_instrument_names()
additional_ccys = [ccy for ccy in refinitiv_ccys if ccy not in ice_ccys]
additional_ccys

Confirm that AUDJPY is unavailable from ICE by querying the data sources associated with the currency pair:

sig.obj.get('AUDJPY CURNCY').data_source_all

Reverting to ICE renders this pair unavailable:

sig.de_init()
sig.init()

Absent a set source, all available sources for an instance are cycled through. Production of a history series will depend on entitlements:

fx = sig.obj.get('EURUSD CURNCY')
fx.history().head()

In this case, ICE_SUPER_DERIVATIVES is our data source:

fx.data_source

Last updated

© 2023 SIG Technologies Limited