Standard continuous-time models like Garman-Kohlhagen (an extension of Black-Scholes for FX) assume frictionless liquidity and continuous price paths. In a fragmented macroeconomic environment subject to geopolitical shocks, capital controls, and clearing sanctions, these models severely underprice tail risk.
This repository implements a Bates Model Monte Carlo simulation to accurately price FX derivatives in discontinuous markets. By combining the Heston model's stochastic volatility with Merton's jump-diffusion, this engine captures both volatility clustering and sudden liquidity gaps.
The core engine simulates the following system of Stochastic Differential Equations (SDEs) under the risk-neutral measure:
1. Spot Exchange Rate Dynamics (Jump-Diffusion):
2. Variance Dynamics (Mean-Reverting Stochastic Volatility):
Where:
-
$dW_t^{(1)}$ and$dW_t^{(2)}$ are Wiener processes with correlation$\rho$ . -
$dq_t$ is a Poisson jump process with intensity$\lambda$ . -
$k$ is the random percentage jump size, distributed log-normally. - The term
$- \lambda \bar{k} dt$ is the martingale compensator to ensure risk-neutrality.
- Euler-Maruyama Discretization: Robust numerical simulation of the Bates SDEs.
- Full Truncation Scheme: Prevents the Feller condition from failing during extreme volatility spikes, ensuring variance remains non-negative.
- Vectorized Poisson Jumps: Highly optimized array operations for rolling discontinuous jump probabilities across thousands of simulated paths.
-
Geopolitical Calibration: Architecture allows for jump intensity (
$\lambda$ ) to be calibrated against alternative data (e.g., sovereign credit default swaps, sanction indices).
For Educational and Research Purposes Only. This software is provided "as is" and is not intended as financial advice, trading signals, or a production-ready risk management system. Do not use this code to allocate real capital. The author is not responsible for any financial losses incurred from the use of this repository.