Skip to content

Grow the FX digital Monte Carlo forward from the spot date to delivery - #494

Open
hereiszepedro wants to merge 2 commits into
FinancePy-Org:masterfrom
hereiszepedro:fix/fx-digital-mc-spot-delivery
Open

hereiszepedro wants to merge 2 commits into
FinancePy-Org:masterfrom
hereiszepedro:fix/fx-digital-mc-spot-delivery

Conversation

@hereiszepedro

Copy link
Copy Markdown
Contributor

#475 made FXDigitalOption.value grow the forward from the spot date to the delivery date and discount the payment from delivery, as FXVanillaOption does. value_mc was left on the old convention: it measured time from the spot date to expiry, discounted over that shorter period as if it started today, and drifted the rate with the zero rates to expiry. So with spot_days > 0 the Monte Carlo price does not converge to the analytic one.

EURUSD, value 9 Mar 2026, expiry 8 Mar 2027, r_d = 3%, r_f = 5%, vol 12%, S = K = 1.10, 2,000,000 paths, MC minus analytic:

spot_days USD call USD put EUR call EUR put
0 (master and this PR) +2.9e-05 -2.9e-05 +5.3e-05 -5.2e-05
2, master +3.9e-04 -6.7e-05 +3.7e-04 +8.5e-05
2, this PR +2.9e-05 -2.9e-05 +5.3e-05 -5.2e-05
5, master +1.3e-03 -2.0e-04 +1.2e-03 +3.9e-04
5, this PR +2.9e-05 -2.9e-05 +5.3e-05 -5.2e-05

This change uses the same forward, delivery discount factor and expiry time in value_mc as in value. With spot_days=0, the default, the discounting is unchanged and prices on flat curves are identical. The regression script does not call value_mc, so no golden log changes.

The first commit adds a test that fails without the fix. A digital call plus a digital put at the same strike pays one unit for sure, so their Monte Carlo sum must equal the analytic sum. On master, the USD pair sums to 0.970685 instead of 0.970366, the discount factor to delivery.

AI-assisted (Claude Code). I checked the numbers above and ran the full unit suite locally.

FXDigitalOption.value builds the forward from the spot date to the
delivery date and discounts the payment from delivery (FinancePy-Org#475). value_mc
still measured time from the spot date to expiry, discounted over that
shorter period as if it started today, and drifted the rate with the
zero rates to expiry. With a spot lag the Monte Carlo price therefore
did not converge to the analytic one: a digital call plus a digital put
paying USD was worth 0.970685 instead of the 0.970366 discount factor
to delivery.

Use the same forward, discount factor and expiry time as value(). With
spot_days=0, the default, the discounting is unchanged and prices on
flat curves are identical.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant