How to change API from Refinitiv Data Platform to Refinitiv Data?

Client is using the python API and are trying to switch from refinitiv.dataplatform to refinitiv.data.
As an example they sent two different scripts from those two libraries and what they want to get is the same output for the following fields:  ‘MarketValueInDealCcy’, 'VegaAmountInDealCcy', 'ThetaAmountInDealCcy' using the same input.
And it seems that between the two libraries there is a different method of providing data.
Do you have any mapping for fields that are used in old and new version, documentation about that change, because we couldn’t find it.
Can you please share your insights regarding the differences between these two?

old script:
capFloorDef = ipa.capfloor.Definition(
notional_ccy="EUR",
start_date="2024-12-31",
end_date="2027-12-31",
buy_sell="Sell",
notional_amount=71100000,
index_name="EURIBOR",
interest_payment_frequency="SemiAnnual",
index_tenor="SemiAnnual",
cap_strike_percent=0,
floor_strike_percent=2.220446049250313e-16)
valuationResult = rdp.get_capfloor_analytics(universe=capFloorDef,
calculation_params=ipa.capfloor.CalculationParams(
valuation_date="2024-11-20",
report_ccy="EUR"),
fields=['MarketValueInDealCcy',
'VegaAmountInDealCcy',
'ThetaAmountInDealCcy'])
#-45603.262079,-2275.055439,382.477931

new script:
import refinitiv.data.content.ipa.financial_contracts as rdf
definition = rdf.cap_floor.Definition(
notional_ccy = "EUR",
start_date = "2024-12-31",
end_date = "2027-12-31",
notional_amount = 71100000,
index_name = "EURIBOR",
index_tenor = "6M",
interest_calculation_method = "Dcb_Actual_360",
interest_payment_frequency = rdf.cap_floor.Frequency.SEMI_ANNUAL,
buy_sell = rdf.cap_floor.BuySell.SELL,
cap_strike_percent = 0,
floor_strike_percent = 2.220446049250313e-16,
pricing_parameters = rdf.cap_floor.PricingParameters(
report_ccy="EUR", valuation_date = "2024-11-20"),
fields = [
"MarketValueInDealCcy",
'VegaAmountInDealCcy',
'ThetaAmountInDealCcy'
],
)
response = definition.get_data()
print(response)
#-4516937.00011158, 0.0, 681.69217952

Tagged:

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Jen_nm08

    Thank you for reaching out to us.

    I checked it and found that when the value of cap_strike_percent is zero, the RDP library will ignore it and doesn't add it in the request message. Therefore, the output will be -45603.262079,-2275.055439,382.477931.

    image.png

    If I add the "capStrikePercent": "0" property in the request message, the output will be -4253551.72254361,0,599.823945.

    image.png

    To get the same value as in the RDP library, the code in RD library should look like this:

    definition = cap_floor.Definition(
        notional_ccy = "EUR",
        start_date = "2024-12-31",
        end_date = "2027-12-31",
        buy_sell = cap_floor.BuySell.SELL,
        notional_amount = 71100000,
        index_name = "EURIBOR",
        interest_payment_frequency = cap_floor.Frequency.SEMI_ANNUAL,
        index_tenor = "SemiAnnual",
        floor_strike_percent = 2.220446049250313e-16,   
        pricing_parameters = cap_floor.PricingParameters(
            report_ccy="EUR", valuation_date = "2024-11-20"),
        fields = [
            "MarketValueInDealCcy",
            'VegaAmountInDealCcy',
            'ThetaAmountInDealCcy'
                ],)
    response = definition.get_data()
    response.data.df
    
    image.png

    I removed the cap_strike_percent property from the code. You can run the help(cap_floor.Definition) command to list all parameters available in the capfloor.Definition class. I think the parameters are similar to the RDP library.