Repository navigation
Resolve two TODOs in BlackVolatilitySurfaceDelta - #2928
Open
Nityahapani wants to merge 1 commit into
Open
Nityahapani wants to merge 1 commit into
Nityahapani wants to merge 1 commit into
Conversation
1. Expose forceMonotoneVariance as a constructor parameter
The variance interpolator for each delta slice was built with
forceMonotoneVariance hardcoded to false:
// TODO: template this so it can be changed
bool forceMonotoneVariance = false;
...
BlackVarianceCurve(ref, dates, vols, dc, forceMonotoneVariance, ...)
The TODO asked to make this configurable. Rather than templating the
whole class (which would break the existing API), expose it as a
constructor parameter forceMonotoneVariance (default false for
backwards compatibility). The value is stored as forceMonotoneVariance_
and passed to each BlackVarianceCurve. Callers who want monotone
variance in time can now set this flag without recompiling.
2. Clarify the atmLevel() formula
atmLevel() returned spot * Bf / Bd with a bare // TODO comment giving
no indication of what needed reviewing. The formula is the standard
FX forward price from interest-rate parity (F = S * B_f / B_d) and
is the correct ATM reference for FX vol surfaces under both spot-delta
and forward-delta conventions. Replaced the TODO with an explanatory
comment confirming the formula is correct and why.
Owner
|
Thanks! May you add a test exercising the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Expose forceMonotoneVariance as a constructor parameter
The variance interpolator for each delta slice was built with forceMonotoneVariance hardcoded to false:
The TODO asked to make this configurable. Rather than templating the whole class (which would break the existing API), expose it as a constructor parameter forceMonotoneVariance (default false for backwards compatibility). The value is stored as forceMonotoneVariance_ and passed to each BlackVarianceCurve. Callers who want monotone variance in time can now set this flag without recompiling.
Clarify the atmLevel() formula
atmLevel() returned spot * Bf / Bd with a bare // TODO comment giving no indication of what needed reviewing. The formula is the standard FX forward price from interest-rate parity (F = S * B_f / B_d) and is the correct ATM reference for FX vol surfaces under both spot-delta and forward-delta conventions. Replaced the TODO with an explanatory comment confirming the formula is correct and why.