Skip to content

HemingwayDu75/usdmad-volatility-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

usdmad-volatility-simulation

Stochastic simulation of USD/MAD exchange rate dynamics using Brownian motion to visualize potential trajectories, risk thresholds, and forward rate targets.

USD/MAD Exchange Rate Simulation using Brownian Motion

This Python script simulates the potential evolution of the USD/MAD exchange rate over a 12-month horizon using a stochastic Brownian motion model. It incorporates budget targets, stop-loss, take-profit levels, and the forward rate, providing a practical visualization of FX risk scenarios.

🎯 Objective

To model a realistic path of the USD/MAD exchange rate by integrating:

  • Market volatility and directional bias
  • Business-level reference points (budget, take-profit, stop-loss)
  • A forward rate comparison after 12 months

🧮 Model Assumptions

The simulation uses a discrete Brownian motion model with drift:

S(t+1) = S(t) + μ·dt + σ·√dt·ε

Where:

  • μ = 0.56% monthly drift (annualized)
  • σ = 15% annualized volatility
  • dt = 1/12 (monthly increments)
  • ε ~ N(0,1) i.i.d. standard normal variables

📊 Parameters

You can customize the following values in the script:

spot_rate = 9.825559          # Initial spot rate USD/MAD
forward_rate = 9.626032       # 12-month forward rate
budget_rate = 9.45            # Internal FX budget assumption
take_profit_levels = [9.85, 10.00, 10.25]
stop_loss_levels = [9.80, 9.50, 9.25]
🖥️ Requirements
Python 3.8+

Packages:

numpy

matplotlib

To install dependencies:pip install numpy matplotlib
▶️ How to Use
Clone or download the repository.

Run the Python script:python usdmad_simulation.py
The output plot will show:

Simulated USD/MAD path over 12 months

Spot rate at start

Forward rate after one year

Budget rate and stop-loss / take-profit threshold📈 Output Example
<!-- Add real image when available -->

🧠 Interpretation
This tool helps visualize:

Whether the forward rate aligns with your business risk tolerance

The likelihood of hitting internal budget targets

Exposure to downside risk under realistic FX market volatility

![exemple_MADUSD_Figure_1](https://github.com/user-attachments/assets/ae769daa-e49e-40a0-a5dd-67180c5360a1)

About

Stochastic simulation of USD/MAD exchange rate dynamics using Brownian motion to visualize potential trajectories, risk thresholds, and forward rate targets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages