Wheel only going long once?

68 views
Skip to first unread message

Ivan Novak

unread,
Oct 11, 2022, 12:34:26 PM10/11/22
to OptionStack
I'm trying to model a modified wheel strategy where:
  1. a cash secured put is sold
    1. if CSP profit > 50% buy to close
    2. if CSP expires allow assignment
  2. on assignment sell covered call
    1. if CC profit > 50% buy to close
    2. if CC expires allow the long position to be called away.
Things are further constrained by only allowing a CSP if no underlying position is held. The setting to deal with offsetting positions seems to be superseded or complicated by the early exit conditions. The simulation appears to perform more to expectations without the setting.

My current problem is it appears as though the CSP will not sell to open a second time, ever. I've done what I can to troubleshoot by plotting open underlying, available buying power, and logging within the "when" block to confirm whether the strategy block is being evaluated.

Here's a snap of how I have things setup currently: 


I'm struggling to understand why the CSP is only firing once. Any help would be greatly appreciated!

OptionStack

unread,
Oct 11, 2022, 12:42:38 PM10/11/22
to OptionStack
Hi Ivan,

Can you click on the Share Button, and post a link to share your strategy?

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 or other services by OptionStack. In addition, the content of the website offers no opinion with respect to the suitability of any security or any specific investment.  There are no guarantees as to 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. Past performance is no indication or guarantee of future results. All investments involve risk – including loss of principal. You should consult with an investment professional before making any investment decisions.

Ivan Novak

unread,
Oct 13, 2022, 10:33:32 AM10/13/22
to OptionStack

OptionStack

unread,
Oct 13, 2022, 10:54:32 AM10/13/22
to OptionStack
By default, once a position is opened, it is considered open unless it has expired or has been explicitly closed by an accompanying order with matching OrderID.  This allows multiple positions to be managed and tracked separately, without worrying about one trade interfering / offsetting another trade unintentionally.

For example, the following example below has two separate trades that offset each other:

OrderId=”SellPut1
Sell Put @ Strike = 100

OrderID = “BuyPut1
Buy Put @ Strike = 100

By default, since both  positions (SellPut1 and BuyPut1) have different OrderIds, they are both considered open and tracked as two separate positions, even though one position effectively offsets / closes the other position.

But if you set the consideredPositionsClosedIfOffsetByIndependentPositions setting, both positions will be considered closed, since they offset each other and result in a net zero position.

In the OptionWheel example, the short in-the-money puts are assigned into long stock.  Covered calls are then sold against the long stock.  When the covered calls are in-the-money, they are assigned into short stock.  The short stock then effectively cancels out the assigned long stock.  

But by default, each position (Short Put / CoveredCall) are still considered open, since they were closed by different OrderID's.   Since each strategy also has a MaxOpen = 1 by default,  new trades will not be opened until the old positions are considered closed. 

That's why the consideredPositionsClosedIfOffsetByIndependentPositions is needed.  Using this setting, both positions will be considered closed, allowing for new trades to be opened.  


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 or other services by OptionStack. In addition, the content of the website offers no opinion with respect to the suitability of any security or any specific investment.  There are no guarantees as to 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. Past performance is no indication or guarantee of future results. All investments involve risk – including loss of principal. You should consult with an investment professional before making any investment decisions.




OptionStack

unread,
Oct 13, 2022, 12:57:11 PM10/13/22
to OptionStack
If for some reason you do NOT want to use the  consideredPositionsClosedIfOffsetByIndependentPositions setting, you can do the following instead:

You can use the netOpenPositionsUsingOffsettingPositions method to check if the position is open, and set the Max Open to a high number.  

netOpenPositions.png

Here is a example:  Backtest Option Wheel

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 or other services by OptionStack. In addition, the content of the website offers no opinion with respect to the suitability of any security or any specific investment.  There are no guarantees as to 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. Past performance is no indication or guarantee of future results. All investments involve risk – including loss of principal. You should consult with an investment professional before making any investment decisions.

Ivan Novak

unread,
Oct 13, 2022, 1:40:46 PM10/13/22
to OptionStack
Excellent, thank you!
Reply all
Reply to author
Forward
0 new messages