marcdemers / py_vollib_vectorized

A vectorized implementation of py_vollib, that supports numpy arrays and pandas Series and DataFrames.
MIT License
121 stars 30 forks source link

vectorized_delta doesn't call numerical_delta_black correctly #3

Open m1jkf00 opened 3 years ago

m1jkf00 commented 3 years ago

Thank you for this package!

When I try to calculate Black deltas using vectorized_delta, it returns an error that numerical_delta_black was passed an unexpected bs argument. I've patched this in my versions of the file by just adding "bs" as an argument to the numerical function, though it probably would have been better to stop greeks.delta from passing the bs argument in the first place.

marcdemers commented 3 years ago

Hi @m1jkf00 , thanks for the bug report. I will fix this in a new version. I kept the delta functions' signatures standardized, which is why I still pass the "bs" arguments to black model.

ccagrawal commented 3 years ago

I'm sure you are aware, but the same is true for the other greeks (e.g. numerical_vega_black and numerical_gamma_black).