About this template
Don't use this one. Use
https://app.optionalpha.com/community/all/post/-the-wheel
A simple "artificial wheel" bot for a single symbol - simple in terms of what it deals with, not so simple in terms of operation. Since we are currently unable to make actual cash secured put trades, or sell covered calls, this bot simulates them using wide put and call spreads. That means that this can't be a "set-and-forget" bot because there exists the possibility of the bot getting out of sync with the actual underlying equity position. This is discussed in a later section.
✅Bot configuration
Everything about the spreads is configurable - in the scanner you can configure how far out in expiration you want to sell puts and calls, the width of both the put and call spreads, and the short leg deltas for both. Or, instead of using a delta value for the short put leg, you can configure the bot to use a specific strike price instead. The current settings for the scanner:
- Symbol = GOLD
- Expiration = 25 to 35 days out
- Short Put Delta = -0.30
- Long Put Offset = $5 below the short put leg
- Short Call Delta = 0 .30
- Long Call Offset = $5 above the short call leg
- Position size = 1 contract
- Use specific strike? = turn on if you want to use a specific strike price for the short put leg instead of a delta setting
- Short put strike = specific strike price for short put leg to be used in place of delta setting
There is one bot level switch that must be set manually due to potential equity position sync errors (discussed later). If set to ON, the bot will assume that the underlying equity already exists in your account and begin selling "covered CALL spreads" (This also takes place if you import an equity position for the symbol being used to wheel). If set to OFF, the bot will begin selling "cash secured PUT spreads" to acquire shares (IFF the bot does not currently hold a long equity position for the symbol).
- Account owns shares? = initial setting is OFF (meaning False)
There are two monitor level switches that relate to closing out the spreads that are substituting for cash secured puts and covered calls.
- Take profits? = If set to true, the monitor will attempt to close out spreads that are in profit if they reach 0.05 delta
- Close threatened positions? = If set to true, the monitor will attempt to close out spreads that are close to going ITM at 0.45 delta
✅Bot Operation
This bot is configured for a single symbol because, in my opinion, you would want (and need) to tune these values for the underlying symbol and share price. And using a single symbol per bot simplifies what needs be kept track of. If the bot has no positions, then it attempts to sell puts. If the bot only has an equity position (or the "account owns shares" switch is ON), then it attempts to sell calls against it. Otherwise, it has no need to do anything.
There are no entry or exit options defined for the spreads - when running the wheel you typically allow things to go to either a worthless expiration or assignment/exercise of the underlying shares. Assignment is really the only complication with a bot like this. Since OA doesn't know about exercises or assignments, you will need to manually import the equity position if assigned, or set the "Account owns shares?" switch. If a call is exercised you will need to override the equity position, if you have one active in OA, and fill in the value received when your shares were exercised away. Or, you can forget about having OA deal with share positions completely and just set the "Account has shares" switch to the appropriate ON or OFF setting until something assignment related happens.
To actually be assigned shares, the "Live Trading" setting in general settings must be set to "Override position and manually enter results" or OA will close out ITM positions with a market order 10 minutes before expiration. NOTE: This change will affect ALL the bots that are running on your live accounts - please realize this and think things through carefully before actually changing this setting for your account.
✅Potential problems
Regardless of this general bot setting, there are other potential problems that exist because OA does not know about being assigned shares or about having your existing shares called away. Since we are dealing with American style options, your short legs are subject to random assignment at any time. I have had options assigned when they still had many days left before expiration and that still had significant extrinsic value left in them. Not that I minded any - someone just handed me some free money - but it can, and sometimes does, happen. This would cause the bots "knowledge" about your equity position to be out of sync with what is actually in your live account.
At spread expiration, OA will override your call or put spread, meaning that the bot could still think you have an equity position and would start trying to sell calls against it when the shares have actually been called away, or think that there are no positions active and start trying to sell put spreads again even though you have already been assigned shares and should be selling calls. As far as I can tell, OA setting your position to OVERRIDE at expiration does not trigger a BOT CLOSED A POSITION event, and even if it did, there doesn't seem to be a way to examine anything about the position that was just closed.
✅Other notes and random thoughts
- Until OA natively supports CSPs and covered calls, it will be easier to forget about managing the equity position and overrides, and just set the switch appropriately. The disadvantage in doing this is that any profits or losses on the equity position will not be included in the bots P/L totals, leaving you no easy way easy to determine the actual basis for shares you own. I use a separate tab in a google sheet to manage every symbol I wheel, and usually run each wheel cycle as a separate campaign, so this is not a concern for me
- The basis of your wheel doesn't need to be an equity position, it could just as easily be a LEAPS. Set the switches ON for "Account owns shares?" and "Close if threatened", and the bot can be used to run artificial PMCCs. With a some creative thinking, tweaking the spread widths, adding in your own desired exit options, and a little bit of manual management, it can even be used to semi-automate selling and managing calendar or diagonal spreads. You probably would not want your Live Trading "In the money Position Action" setting set to "Override position and manually enter results" in these cases.
- If you are trying to have shares assigned, your account obviously needs to have sufficient capital or margin to have them be assigned. Unless you have a very large account, you will not be wheeling anything close to QCOM or NVDIA stock, or even TSLA. I recommend having an account at least twice the size of the share value you are wheeling - that means $5,000 to wheel 1 contract of a $25 stock, $10,000 for a $50 stock, and so on.
- Running the wheel is not a "get rich quick" type process. It requires patience and good stock selections. It usually returns small percentage returns over long periods of time.
- This bot is probably full of bugs and oversights. If you find any, please let me know. I run it live because I wrote it, watch it closely, and I'm willing to live with the consequences if something goes horribly wrong. You probably shouldn't do that - I recommend running it in paper until you are familiar with how it operates. Please do not take the chance of having it blow up a live account - do some testing with it first.