QuantLib icon indicating copy to clipboard operation
QuantLib copied to clipboard

Teach Engine to compute greeks

Open antoscha opened this issue 2 years ago • 5 comments

Hello!

I found that calling option.delta() having BjerksundStenslandApproximationEngine used as the pricing engine causing RuntimeError: delta not provided although the main code in bjerksundstenslandengine.cpp is seemed to provide this result. Can I ask you to implement greeks into pricing engines in the Python interface please?

Anton K.

antoscha avatar May 13 '22 14:05 antoscha

In the case if it's not possible please consider using this method as an appropriate fallback for an american option.

antoscha avatar May 23 '22 16:05 antoscha

I'm moving the issue to the C++ repo the relevant calculations are in the underlying C++ code.

The code currently provides Greeks only when the option is equivalent to a European one, not when actually using the approximation. It's probably possible to provide a formula for the derivative of the approximation formula, but it doesn't look trivial. In the meantime, you can calculate Greeks by bumping the underlying variable and repricing.

lballabio avatar Jun 03 '22 15:06 lballabio

Thanks for posting! It might take a while before we look at your issue, so don't worry if there seems to be no feedback. We'll get to it.

boring-cyborg[bot] avatar Jun 03 '22 15:06 boring-cyborg[bot]

There seems to have been work done by @klausspanderen in 1b66279eb2d8363be27364843afedcc68ce67604 . Greeks are supported and tested for European and American options. Is there still more to do?

PaulXiCao avatar Mar 18 '24 15:03 PaulXiCao

Nope—thanks for noticing.

lballabio avatar Mar 19 '24 09:03 lballabio