.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/options/closed_form/plot_06_garman_kohlhagen.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_options_closed_form_plot_06_garman_kohlhagen.py: Garman-Kohlhagen currency options ================================= Mark Garman and Steven Kohlhagen (1983) noticed that a unit of foreign currency is an asset that pays the foreign interest rate :math:`r_f`, just as a stock pays a dividend yield. Merton's dividend formula then prices FX options: .. math:: c = S e^{-r_f T} N(d_1) - K e^{-r_d T} N(d_2). A call on one currency is a put on the other, which gives a symmetry check. .. GENERATED FROM PYTHON SOURCE LINES 17-22 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from financialkit.options import garman_kohlhagen_price .. GENERATED FROM PYTHON SOURCE LINES 23-25 Haug's example -------------- .. GENERATED FROM PYTHON SOURCE LINES 25-29 .. code-block:: Python price = garman_kohlhagen_price(1.56, 1.60, 0.5, 0.06, 0.08, 0.12) print(f"six-month call, S = 1.56, K = 1.60, r_d = 6%, r_f = 8%: {price:.4f} (Haug: 0.0291)") .. rst-class:: sphx-glr-script-out .. code-block:: none six-month call, S = 1.56, K = 1.60, r_d = 6%, r_f = 8%: 0.0291 (Haug: 0.0291) .. GENERATED FROM PYTHON SOURCE LINES 30-36 Foreign-domestic symmetry ------------------------- A call to buy one unit of foreign currency at :math:`K` equals :math:`S K` times a put, in foreign units, to sell one unit of domestic currency at :math:`1/K`, with the rates swapped and the spot inverted. .. GENERATED FROM PYTHON SOURCE LINES 36-42 .. code-block:: Python S, K, T, rd, rf, sigma = 1.56, 1.60, 0.5, 0.06, 0.08, 0.12 call = garman_kohlhagen_price(S, K, T, rd, rf, sigma) put_inverse = garman_kohlhagen_price(1 / S, 1 / K, T, rf, rd, sigma, "put") print(f"call {call:.6f} = S K x inverse put {S * K * put_inverse:.6f}") .. rst-class:: sphx-glr-script-out .. code-block:: none call 0.029099 = S K x inverse put 0.029099 .. GENERATED FROM PYTHON SOURCE LINES 43-45 The interest-rate differential shifts the forward ------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 45-56 .. code-block:: Python spots = np.linspace(1.3, 1.9, 121) fig, ax = plt.subplots(figsize=(7, 4)) for rf in (0.0, 0.04, 0.08): ax.plot(spots, garman_kohlhagen_price(spots, K, 1.0, 0.06, rf, sigma), label=f"r_f = {rf:.0%}, forward = {1.56 * np.exp(0.06 - rf):.3f}") ax.set_xlabel("spot exchange rate") ax.set_ylabel("call value (domestic per foreign)") ax.legend() fig.tight_layout() plt.show() .. image-sg:: /api/gallery/options/closed_form/images/sphx_glr_plot_06_garman_kohlhagen_001.png :alt: plot 06 garman kohlhagen :srcset: /api/gallery/options/closed_form/images/sphx_glr_plot_06_garman_kohlhagen_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.042 seconds) .. _sphx_glr_download_api_gallery_options_closed_form_plot_06_garman_kohlhagen.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../../lite/lab/index.html?path=api/gallery/options/closed_form/plot_06_garman_kohlhagen.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_06_garman_kohlhagen.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_06_garman_kohlhagen.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_06_garman_kohlhagen.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_