-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Description
Expected Behavior
When we call one of the OptionStrategies functions, if it can't find the selected contracts in the OptionChain, it throws an error message.
Actual Behavior
It throws no error message. We only get an error message after we try to place the order.
Potential Solution
The leg 'SPY 210416C00390000' does not have an active subscription.
or
short_straddle = OptionStrategies.short_straddle(self._option_symbol, strike, expiry)
if short_straddle.is_tradable:
tickets = self.buy(short_straddle, 1)
Reproducing the Problem
In this algorithm, the call contract is removed from the chain but the put contract remains in the chain.
As a result, when I try to create the Option strategy the second time, I get
The security with symbol 'SPY 210416C00390000' is marked as non-tradable.
(and end up with a missing leg)
https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_f06123357019037c268be2826cc9fb5d.html
2021-03-22 09:31:00 2021-03-22 09:31:00 - 0 in chain
2021-03-22 09:31:00 2021-03-22 09:31:00 - 1 in chain
2021-03-22 09:31:00 2021-03-22 09:31:00 - expiry: 2021-04-16 00:00:00; strike: 390.0
2021-04-12 06:30:00 2021-04-12 06:30:00 - exercised
2021-04-12 09:31:00 The security with symbol 'SPY 210416C00390000' is marked as non-tradable.
2021-04-12 09:31:00 2021-04-12 09:31:00 - 1 in chain
2021-04-12 09:31:00 2021-04-12 09:31:00 - expiry: 2021-04-16 00:00:00; strike: 390.0
System Information
QC Cloud
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- I have provided detailed steps to reproduce the issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels