Hi,
I am trying to use the pricing template for swaption from the codebook. However, I am not sure how to enter the field and the final fair value can not match with my sample.
I have attached the screenshot of the sample information and testing result to the question as well as pasting my code below. Would you mind advise me how to adjust my code? Thanks.
import refinitiv.data as rd
from refinitiv.data.content.ipa.financial_contracts import swaption
from refinitiv.data.content.ipa.financial_contracts import swap
rd.open_session()
response = swaption.Definition(
instrument_tag="USD",
settlement_type=swaption.SwaptionSettlementType.PHYSICAL,
notional_amount=150000000,
strike_percent=3.7,
buy_sell=swaption.BuySell.BUY,
swaption_type=swaption.SwaptionType.RECEIVER,
start_date="2025-08-21",
end_date="2035-08-21",
exercise_style=swaption.ExerciseStyle.EURO,
underlying_definition=swap.Definition(
tenor="10Y",
template="EUR_AB6E"
),
pricing_parameters=swaption.PricingParameters(
market_data_date="2024-12-31",
valuation_date="2024-12-31"
),
fields=["InstrumentTag",
"InstrumentDescription",
"StartDate",
"EndDate",
"MarketValueInDealCcy",
"DeltaAmountInDealCcy",
"DeltaPercent",
"GammaAmountInDealCcy",
"GammaPercent",
"ThetaAmountInDealCcy",
"ThetaPercent",
"VegaAmountInDealCcy",
"VegaPercent",
"DiscountCurveName",
"ForwardCurveName",
"ErrorCode",
"ErrorMessage"]
).get_data()
print(response.data.df["MarketValueInDealCcy"])
Regards,
Yang Shuai