hayden4r4 / blackscholes-rust

A Black-Scholes pricing model built in Rust
MIT License
8 stars 6 forks source link

correct `calc_rational_iv` inputs with rate and dividend #3

Closed yonch closed 10 months ago

yonch commented 10 months ago

after perusing the formulas in section 1 and 2 of the "Let's be rational" paper, it seems the formulas would use the undiscounted price (first paragraph of Section 1), and would use the forward price (formula 2.1 and variable naming in code).

Also took into account the continuous dividend q.

With these changes, calc_rational_iv now gives comparable results to the black_scholes crate for me.

Thank you to the contributors for the work you put in this crate! Loved that "let's be rational" is available in Rust! 🙏

hayden4r4 commented 10 months ago

Nice, thanks for your work on this. I figured a conversion needed done there but have been too lazy to work on it.