Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OptionGreekIndicatorsHelper Handles Extreme Cases #7998

Closed
4 tasks done
AlexCatarino opened this issue May 6, 2024 · 0 comments · Fixed by #7999
Closed
4 tasks done

OptionGreekIndicatorsHelper Handles Extreme Cases #7998

AlexCatarino opened this issue May 6, 2024 · 0 comments · Fixed by #7999
Assignees
Labels

Comments

@AlexCatarino
Copy link
Member

Expected Behavior

Methods in OptionGreekIndicatorsHelper don't throw exceptions.

Actual Behavior

2024-05-06T17:39:56.3635659Z ERROR:: Extensions.SetRuntimeError(): Extensions.SetRuntimeError(): RuntimeError at 11/17/2022 14:31:00 UTC. Context: Consolidators update System.OverflowException: Value was either too large or too small for a Decimal.
   at System.Number.ThrowOverflowException(TypeCode type)
   at System.Decimal.DecCalc.VarDecFromR8(Double input, DecCalc& result)
   at QuantConnect.Indicators.OptionGreekIndicatorsHelper.CalculateD1(Decimal spotPrice, Decimal strikePrice, Decimal timeToExpiration, Decimal riskFreeRate, Decimal dividendYield, Decimal volatility) in /Indicators/OptionGreekIndicatorsHelper.cs:line 60
   at QuantConnect.Indicators.Delta.CalculateGreek(Decimal timeTillExpiry) in /Indicators/Delta.cs:line 187

Potential Solution

Catch the exception and return zero/null.

Reproducing the Problem

Uncomment line 19 in the following backest:
https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_12c64efdee07683a80517154b4a6d52e.html

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants