QuantConnect/Lean

Greeks indicators should be able to calculate on expiration date

Closed this issue · 0 comments

Expected Behavior

Greeks indicators are able to calculate on expiration date. Options are not delisted right at midnight, so they still could have greeks on that date.

Actual Behavior

Some greeks indicators throw when calculating on expiration date when they use timeTillExpiry as the denominator of a division.

Potential Solution

Check each indicator and see if they can have actual values on expiration date. At least they could detect timeTillExpiry == 0 and return an invalid value if necessary.

The OptionGreeksIndicatorBase class allows calculation on expiration date but some of the actual derived class don't do any checking on this.

Reproducing the Problem

Clone this backtest

System Information

Windows 11
QC Cloud

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