Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthetic calibrator extended to support Cross-currency swaps. #1976

Merged
merged 2 commits into from
May 23, 2019

Conversation

marc-henrard
Copy link
Contributor

Synthetic calibrator did not support the cross-currency instruments (FX swaps and XCcy swaps) because the way the FxRateId was treated. Code has been improved to deal with QuoteId and FxRateId separetely.

// Generate quotes for FX pairs. The first currency is arbitrarily selected as starting point.
// The crosses are automatically generated by the MarketDataFxRateProvider used in calibration.
for (int loopccy = 1; loopccy < ccyRequired.size(); loopccy++) {
CurrencyPair ccyPair = CurrencyPair.of(ccyRequired.get(0), ccyRequired.get(loopccy));
FxRateId fxId = FxRateId.of(ccyPair);
mapIdSy.put(fxId, FxRate.of(ccyPair, inputProvider.fxRate(ccyPair)));
mapId0.put(fxId, FxRate.of(ccyPair, inputProvider.fxRate(ccyPair))); // Required to generate the trade
Copy link
Contributor

@yukiiwashita yukiiwashita May 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because MarketData created from this map is used in CurveNode for cross currency products without MarketDataFxRateProvider, FX crosses are not generated. Thus the exact FxRateIds are required for all of the possible pairs.

@marc-henrard marc-henrard merged commit 21bf40a into master May 23, 2019
@delete-merged-branch delete-merged-branch bot deleted the wip/synth-cal-fx branch May 23, 2019 16:40
@jodastephen jodastephen added this to the v2.4 milestone May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants