eddelbuettel / rquantlib

R interface to the QuantLib library
120 stars 50 forks source link

Implied vol of a binary european option doesn't converge #170

Closed wklm closed 2 years ago

wklm commented 2 years ago
RQuantLib::BinaryOptionImpliedVolatility(
  type = "call",
  value = 5.1164,
  underlying = 28,
  strike = 65,
  dividendYield = 0,
  riskFreeRate = 0,
  maturity = 218/365,
  volatility = .83,
  cashPayoff = 100
)

results in:

Error in binaryOptionImpliedVolatilityEngine(type, value, underlying,  : 
  root not bracketed: f[1e-07,4] -> [-5.116400e+00,-1.663857e+00]

while 83% is exactly the implied vol of this option

eddelbuettel commented 2 years ago

My first instinct is always for corner conditions in parameters so maybe try with a really small, but non-zero, rate and divididend yields.

Edit Ok, that is not it but when I run a BinaryOption pricer on those parameters, I get 4.99 as the value. Anyway, RQuantLib only calls into QuantLib so you may need to discuss the pricing / implied vol aspects there.

wklm commented 2 years ago

Thanks @eddelbuettel, I'll follow up with them. Let's hope it's fixed in one of the future Quantlib releases. This issue here can be closed. Cheers!