From 34c396960a7bd413da46a02a032fac5e8a42e92e Mon Sep 17 00:00:00 2001 From: Justin Lars Kirkby <33753270+jkirkby3@users.noreply.github.com> Date: Mon, 15 Apr 2024 19:41:27 -0400 Subject: [PATCH] Update black_scholes.py Fix bug in delta --- fypy/pricing/analytical/black_scholes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fypy/pricing/analytical/black_scholes.py b/fypy/pricing/analytical/black_scholes.py index bc9780c..e8294c1 100644 --- a/fypy/pricing/analytical/black_scholes.py +++ b/fypy/pricing/analytical/black_scholes.py @@ -97,7 +97,7 @@ def black76_delta(F: float, :return: float or np.ndarray, same shape as strikes """ vol_st = vol * np.sqrt(T) - phi = 1 if is_call else 0 + phi = 1 if is_call else -1 d_1 = (np.log(F / K) + 0.5 * vol_st ** 2) / vol_st delta = phi * norm.cdf(phi * d_1) if is_fwd_delta: