I have a covered call strategy that works well.  No issues with the code, however, I ran into an issue where a covered call was assigned last night but my algo did not track it correctly.  Here's what happened.  I had 100 shares of QQQ and a covered call with strike of 363.  During the day, when the price went above 363, I bought another 100 of QQQ.  At the end of the day QQQ closed above 363 at 363.86.  Afterhours the price dipped.  Now here is the issue.  My algo thinks the price dipped to 362.66 and the buy option exercise was completed at 01:33 to close the option position since the price was below the strike.  However, this did NOT happen.  Interactive brokers shows that 100 shares were assigned at 22:33.  I think the time difference is likely just that I'm in California and its 3 hours to new york.  That explains the 01:33 time mark (which I thought was unusual).  The issue here is that someone exercised the call at that time and I was assigned and lost those shares at $363.00 at 22:33 but my algo thinks the call expired worthless with the underlying price at $262.66.  To make thinks more complicated, my algo then put in a sell on market open order for 100 shares at 04:36.  That one I cant figure out as I cant find anywhere in my code that would do something like that.  I have no idea why it did that but I think its connected to the issue above.  I'm probably going to place a scheduled function 1 minute before open to clear any open orders to prevent that sell on market open order from executing if it happens again and it only has ever happened under this circumstance.  

Has anyone else ran into issues with covered calls being assigned but quantconnect not tracking those assignments correctly?  How can we avoid or correct this?  

 

Thanks!  David