danielhstahl / black_scholes_rust

Rust for black scholes
https://danielhstahl.github.io/black_scholes_rust/dev/bench/
23 stars 8 forks source link

Add support for dividend yield #25

Open extremeandy opened 1 year ago

extremeandy commented 1 year ago

Would like to see support for dividend yield as per e.g. https://www.macroption.com/black-scholes-formula/

Personally I wouldn't mind it being a breaking change on a new major version having the new parameter as part of all functions. I'd be happy to submit a PR.

danielhstahl commented 1 year ago

How realistic is having a continuous dividend yield? If it is not realistic, there is a lot of added complexity for no gain.

If it is required feel free to PR.

rob-keyrock commented 1 year ago

Hey, so in practicality dividends will of course be paid out in discrete increments throughout the year. However, this can easily be converted into an annualized continuous yield. Me and extremeandy both have a use case for this so if it is possible it would be fantastic to have the feature added.

danielhstahl commented 1 year ago

Conceptually I'm not sure its "easily converted" but I could be wrong :). Like I said I'm fine with y'all PRing a breaking change involving dividends. It may be worthwhile making the dividend argument an Option type which will make the code slightly more efficient if dividends aren't required.