Skip to content

Commit

Permalink
Update black_scholes.py
Browse files Browse the repository at this point in the history
Fix bug in delta
  • Loading branch information
jkirkby3 authored Apr 15, 2024
1 parent feddd78 commit 34c3969
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fypy/pricing/analytical/black_scholes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 34c3969

Please sign in to comment.