Hi Neil,
I've refactored the code you provided for binary barriers. The main reason was that I prefer to look at these options as American exercise option with binary payoff, instead of barrier options. As a matter of fact if one looks at the paper I've attached here one can notice that options 1-8 do not depend on the strike, they only depend on the barrier level. Just rename the barrier level as strike and one has gone from "binary barrier" to "American binary" options. Namely: 1) down-and-in cash-at-hit-or-nothing is American put with cash-at-hit-or-nothing binary payoff 2) up-and-in cash-at-hit-or-nothing is American call with cash-at-hit-or-nothing binary payoff 3) down-and-in asset-at-hit-or-nothing is American put with asset-at-hit-or-nothing binary payoff 4) up-and-in asset-at-hit-or-nothing is American call with asset-at-hit-or-nothing binary payoff 5) down-and-in cash-at-expiry-or-nothing is American put with cash-at-expiry-or-nothing binary payoff 6) up-and-in cash-at-expiry-or-nothing is American call with cash-at-expiry-or-nothing binary payoff 7) down-and-in asset-at-expiry-or-nothing is American put with asset-at-expiry-or-nothing binary payoff 8) up-and-in asset-at-expiry-or-nothing is American call with asset-at-expiry-or-nothing binary payoff As of now both the "binary barrier" and the "American digital" options are available in the QuantLib CVS. I am going to deprecated few files (in parenthesis the suggested alternative): 1) ql/MonteCarlo/binarybarrierpathpricer.*pp (ql/MonteCarlo/digitalpathpricer.*pp) 2) ql/PricingEngines/Barrier/analyticamericanbinarybarrierengine.*pp (ql/PricingEngines/Vanilla/analyticamericanengine.*pp) 3) ql/PricingEngines/Barrier/analyticeuropeanbinarybarrierengine.*pp (ql/PricingEngines/Vanilla/analyticeuropeanengine.*pp) 4) ql/PricingEngines/Barrier/mcbinarybarrierengine.hpp (ql/PricingEngines/Vanilla/mcdigitalengine.hpp) 5) ql/Instruments/binarybarrieroption.*pp (ql/Instruments/vanillaoption.*pp) 6) test-suite/binarybarrieroption.*pp (test-suite/digitaloption.*pp) I'm considering removing the deprecated files before the next release, unless anyone relies on them. I would do this for sake of clarity and because while moving from "binary barrier" to "American binary" I've also fixed few bugs and made little improvements which would require some time to be applied to binary barriers... I'm posting this to QuantLib-users since if anyone on this list wants to take a look at the code and give some feedback it would be welcome. There is also so much work still to do about the greeks of American at-hit and American at-expiry, on the MC simulation of the American cash-at-hit and American asset binary options, etc. BTW now American binary engines are available for whatever "vanilla" option we have in QuantLib. ciao -- Nando Binary Options.doc (117K) Download Attachment |
Free forum by Nabble | Edit this page |