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
Answers
-
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.
If I add the "capStrikePercent": "0" property in the request message, the output will be -4253551.72254361,0,599.823945.
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
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.
1
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 33 Data Model Discovery
- 682 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.8K Refinitiv Data Platform
- 622 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 83 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛