QuantConnect / Lean

Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
https://lean.io
Apache License 2.0
9.89k stars 3.27k forks source link

Expired Index Option Contracts Aren't Always Exercised #8413

Open DerekMelchin opened 2 hours ago

DerekMelchin commented 2 hours ago

Expected Behavior

If we hold an Index Option contract and it expires, it's automatically exercised.

Actual Behavior

It's not always exercised.

Potential Solution

N/A

Reproducing the Problem

Run this backtest. The algorithm runs until 2024, but this last 0DTE contract isn't automatically exercised on expiry like all the other trades in the backtest. image

System Information

QC Cloud

Checklist

AlexCatarino commented 2 hours ago

Note the 0DTE contract expires on July 3rd (holiday eve). If we set the start date to 2024, it stops trading on Jun 18th (eve of Juneteenth).