Add support for negative rates on barrier options. #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of flooring to zero as done in the pricing module, here we need
a very small value to avoid similar divide by 0 problems. For this,
we use the "SMALL_VALUE_MU" which seems tailor-made for the purpose.
Also, some cleanup and rationalization of the test file to make it
easier to understand both the source and output. Plus, of course, adding
a couple test cases for the improved functions.
All of the values seem reasonable to the untrained eye.
cc: @junbon @rakshit-binary @kavehmz @jy-binary
NB: the travis tests may fail if Binaries v1.22 is not yet widely available. This will not be merged until tests pass, but no further code changes are expected to make that happen.
Edit to add: tests pass, so I guess you can ignore the above.