LSEG Data Library for Python

create_udc

Sends a request to the Delivery Platform (formerly Refinitiv Data Platform) to create UDC synthetic instruments.

Module

refinitiv.data.content.custom_instruments.manage

Syntax

create_udc(symbol, udc)

Parameters

Value Description Data type Optional Default value
symbol Instrument symbol in the format "S)someSymbol.YOURUUID". str No -
udc Custom trading sessions, see sample format below. UDC or dict No -
instrument_name Human-readable name of the instrument. Maximum of 16 characters. str Yes None
exchange_name 4-letter code of the listing exchange. str Yes None
currency 3-letter code of the currency of the instrument, e.g. GBP. str Yes None
time_zone Time Series uses an odd custom 3-letter value for time zone IDs, e.g. "LON" for London. str Yes None
holidays List of custom calendar definitions. List[Holiday] or list[dict] Yes None
description Free text field from the user to put any notes or text. Up to 1000 characters. list[dict] Yes None
extended_params Specifies the parameters that will be merged with the request. dict Yes None
closure Closure parameters that will be returned with the response Any Yes None
session Session object. If session parameters are not defined, the default session will be used. Session object Yes None
on_response User-defined callback function to process received response. Callable Yes None

Returned value

CustomInstrumentUDC

Usage

The following example demonstrates how to create a custom instrument based on formula "EUR=*3":

from refinitiv.data.content.custom_instruments.manage import create_udc
import refinitiv.data.content.custom_instruments as ci

response_1 = create_udc(
    symbol="MyUDCInstrument_VB",
    instrument_name="Co Systems Inc",
    udc=ci.manage.UDC(
        root="CC",
        months=ci.manage.Months(
            number_of_years=3,
            include_all_months=True,
            start_month=1,
        ),
        rollover=ci.manage.VolumeBasedRollover(
            method=ci.VolumeBasedRolloverMethod.VOLUME,
            number_of_days=1,
            join_at_day=1,
            roll_occurs_within_months=4,
            roll_on_expiry=True,
        ),
        spread_adjustment=ci.manage.SpreadAdjustment(
            adjustment="arithmetic",
            method=ci.SpreadAdjustmentMethod.CLOSE_TO_CLOSE,
            backwards=True,
        ),
    )
)
206 words (1:05 mins)