Correct FX digital payout-currency valuation - #260
Open
kadyrbekovhamit-cyber wants to merge 1 commit into
Open
kadyrbekovhamit-cyber wants to merge 1 commit into
kadyrbekovhamit-cyber wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FXDigitalOptionsupports a payout/notional in either the domestic or theforeign currency. A foreign-currency payout has domestic payoff
S_T * 1(condition), so it is an asset-or-nothing payoff and itsGarman--Kohlhagen value uses
N(d1). The existing implementation usesN(d2), which is the probability term for a domestic cash-or-nothing payout.The related
FXDoubleDigitalOptionhas two corresponding issues:d2probability terms insteadof the
d1asset terms.This change uses
d1for foreign-currency single and interval payouts, whileusing the already calculated domestic and foreign discount factors for their
respective payoff currencies. Domestic single-digital valuation is unchanged.
Synthetic example
For EURUSD spot 1.20, strike 1.25, one-year expiry, domestic rate 5%, foreign
rate 1%, and volatility 20%, a one-EUR digital call currently returns
0.5449552491USD. The asset-or-nothing formula gives0.6397169446USD.For an interval from 1.10 to 1.40 under the same inputs:
0.4474588468, expected0.4298665323;0.5369506162, expected0.5338519318.The test oracle uses Python's
math.erf, independently of FinancePy's vectornormal-CDF approximation.
Validation
RankWarningmessages;affected cases and passes the two unchanged domestic single-digital
controls;
All inputs are synthetic. This PR makes no claim about a downstream system,
customer position, or financial loss.