Hello, I am experimenting with the wheel strategy and with some stocks I have the problem that the equity does not arrive in the portfolio during the automatic assignment.
This then leads to the situation that no calls but further puts are sold and at some point the whole backtast delivers strange results.
On January 13, a put was sold 220121P00019000 which was assigned on 22.
AAL 220121P00019000 - 53 Filled Automatic Assignment
AAL, however, was then not in the portfolio on January 24, so puts continued to be sold.
Currently I am at a loss, sometimes the assignment goes sometimes not.
Kai
Here are some Log Outputs
2022-01-13 10:47:00 TradePutOption AAL: 0 @ 0 [] 101449.0
2022-01-13 10:47:00 OnOrderEvent AAL: 0 @ 0 Time: 01/13/2022 15:47:00 OrderID: 4 EventID: 2 Symbol: AAL 220114P00018000 Status: Filled Quantity: 55 FillQuantity: 55 FillPrice: 0.04 USD LimitPrice: 0.04 OrderFee: 13.75 USD IsAssignment: False
2022-01-13 10:47:00 OnOrderEvent AAL: 0 @ 0 Time: 01/13/2022 15:47:00 OrderID: 5 EventID: 1 Symbol: AAL 220121P00019000 Status: Submitted Quantity: -53 IsAssignment: False
2022-01-13 10:47:00 OnOrderEvent AAL: 0 @ 0 Time: 01/13/2022 15:47:00 OrderID: 5 EventID: 2 Symbol: AAL 220121P00019000 Status: Filled Quantity: -53 FillQuantity: -53 FillPrice: 0.43 USD OrderFee: 13.25 USD IsAssignment: False
2022-01-13 10:47:00 OnOrderEvent AAL: 0 @ 0 Time: 01/13/2022 15:47:00 OrderID: 6 EventID: 1 Symbol: AAL 220121P00019000 Status: Submitted Quantity: 53 LimitPrice: 0.09 IsAssignment: False
2022-01-22 00:00:00 OnAssignmentOrderEvent AAL: 0 @ 0 Time: 01/22/2022 05:00:00 OrderID: 7 EventID: 1 Symbol: AAL 220121P00019000 Status: Filled Quantity: 53 FillQuantity: 53 FillPrice: 0 Message: Automatic Assignment IsAssignment: True
2022-01-22 00:00:00 TradePutOption AAL: 0 @ 0 [] 103714.75
2022-01-22 00:00:00 OnOrderEvent AAL: 0 @ 0 Time: 01/22/2022 05:00:00 OrderID: 7 EventID: 1 Symbol: AAL 220121P00019000 Status: Filled Quantity: 53 FillQuantity: 53 FillPrice: 0 Message: Automatic Assignment IsAssignment: True
2022-01-22 00:00:00 OnOrderEvent AAL: 0 @ 0 Time: 01/22/2022 05:00:00 OrderID: 6 EventID: 2 Symbol: AAL 220121P00019000 Status: CancelPending Quantity: 53 LimitPrice: 0.09 IsAssignment: False
2022-01-22 00:00:00 OnOrderEvent AAL: 0 @ 0 Time: 01/22/2022 05:00:00 OrderID: 6 EventID: 3 Symbol: AAL 220121P00019000 Status: Canceled Quantity: 53 LimitPrice: 0.09 IsAssignment: False
2022-01-24 09:31:00 OnOrderEvent AAL: 0 @ 0 Time: 01/24/2022 14:31:00 OrderID: 8 EventID: 1 Symbol: AAL 220128P00015500 Status: Submitted Quantity: -66 IsAssignment: False
2022-01-24 09:31:00 OnOrderEvent AAL: 0 @ 0 Time: 01/24/2022 14:31:00 OrderID: 8 EventID: 2 Symbol: AAL 220128P00015500 Status: Filled Quantity: -66 FillQuantity: -66 FillPrice: 0.37 USD OrderFee: 16.5 USD IsAssignment: False
2022-01-24 09:31:00 OnOrderEvent AAL: 0 @ 0 Time: 01/24/2022 14:31:00 OrderID: 9 EventID: 1 Symbol: AAL 220128P00015500 Status: Submitted Quantity: 66 LimitPrice: 0.07 IsAssignment: False
Kai Kramer
I made another strange observation. If I do NOT cancel the take profit order of the put option at the time of assignment, the assignment works ⁈
Louis Szeto
Hi Kai
Thank you for your patience. The problem is coming from the OnAssignmentOrderEvent method. Changing
into
will solve the issue.
Best
Louis
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Kai Kramer
Thanks, that works for me.
Kai Kramer
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!