QuantLib
QuantLib copied to clipboard
Teach Engine to compute greeks
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.
In the case if it's not possible please consider using this method as an appropriate fallback for an american option.
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.
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.
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?
Nope—thanks for noticing.