About this template
This is a variation of James' TC 0DTE bot. https://app.optionalpha.com/community/templates/post/tc-0dte
I have found that using delta values for the short strikes can lead to times when premium collected on one side is very lopsided compared with the other side ($0.26 vs $0.10 for SCS/SPS). See below.
A stop loss on the side with the higher premium would cause a disproportionate loss occurring on one side and the gain on the other side (assuming it wins) not being able to offset the loss very much at all. As an example, IF the above SCS would have stopped out (at 300%, which is the default for the strategy), its loss would would have been $0.78 per contract, whereas the gain on the SPS would have only been $0.10 per contract.
My solution was to open spreads for each side of the IC based on a minimum bid price instead of delta values. My scanner finds and then opens the spread that gives me (at least) my minimum bid price and that is furthest OTM based on that bid price (short strike search starts at $12 above/below the underlying price and goes to $3). This way, the IC is more balanced.
Scanners
There are 2 scanners to open positions - one for the call side and another for the put side. Set the "Open SPS/SCS Positions" toggles to allow initial positions to be opened starting at the first scan time of 9:45 am. If one side or the other does not fill, it will try again at the next scan up until and including 10:30 am. Set the "Min Bid Price" to your preference. I have found that $0.13 (default value) puts me close to the 10 Delta mark these days (may change in the future based on volatility?). Other default values are 50% net liquid per spread (opens more contracts as profit increases) and $5 spread width. "Open Price" is set to 100% of B/A spread using Fast SmartPricing.
There are also toggles to re-enter a position if its stopped out or closed for any other reason. See Stop Loss section below.
The Monitor (v2)
The "Monitor On/Off" toggle turns the monitor on/off. Exit options are updated according to descriptions below. When "off", all exit options are reset/disabled.
Stop Loss Check: Before 12:00 pm, the "Loose S/L EO" will trigger at a 400% S/L. At 12:00 pm or after, the "Default S/L EO" will trigger at a 300% S/L. Closing a position by one of these S/Ls will trigger the scanner to run once again. If the current market time is 1:00 pm or earlier, VIX is below the "VIX High" threshold, and the "Re-enter SPS/SCS Positions" toggle is on, the bot will attempt to re-enter a new position.
EOD Checks: From 3:00 - 3:40 pm (or 12:00 - 12:40 pm on early close days), the bot closes any position above "PT Low (%)" AND below "PT Mid (%)". At 3:45 pm (or 12:45 pm on early close days) or after, the bot closes any position below "PT Mid (%)". There is also a "Tradier Close" switch that will close positions at 3:00 pm if a short leg of a position is < "OTM EOD Exp Close Amount ($)" or > "Chance of ITM EOD Exp Close Amount (%)". Defaults are $3 and 15%, respectively.
Risk Reversal Close: There is a switch (default is set to "Off") to close positions that were once low risk but are reversing. These conditions are:
- If it is 10:30 am or after, and a position once had a mark price of $0.01 or $0.02, and now the mark price is > $0.03, AND position return is > "PT Min (%)", close the position.
- If it is 11:30 am or after, and a position once had a mark price of $0.03, and now the mark price is > $0.05, AND position return is > "PT Min (%)",close the position.
- If it is 1:00 pm or after, and a position once had a mark price of $0.04, and now the mark price is > $0.06, AND position return is > "PT Min (%)",close the position.
- If it is 2:30 pm or after, and a position once had a mark price of $0.05, and now the mark price is > $0.08, AND position return is > "PT Min (%)",close the position.
If none of these EOD or S/L conditions are met, the positions will be left to expire. User beware!
The Monitor (v1)
The "Monitor On/Off" toggle turns the monitor on/off.
Stop Loss Check: The monitor first checks each position to see if the stop loss (default is 300%) has been hit. If so, it closes the losing position. Closing positions also triggers the scanner to run once again. If the current market time is before 1:00 pm, VIX is below the "VIX High" threshold, and the "Re-enter SPS/SCS Positions" toggle is on, the bot will attempt to re-enter a new position.
EOD Checks: From 3:00 - 3:30 (or 12:00 - 12:30 on early close days), the bot closes any position above "Profit Target Low" AND below "Profit Target Mid". After 3:30 (or 12:30 on early close days), the bot closes any position below "Profit Target Mid". There are also toggles to close positions early on FOMC announcement days ("FOMC Early Close" - closes positions at 1:45) or early market close days ("Early Close"). The user must know these days in advance and set the toggles appropriately and reset them the following trading day.
Profit Target High Check: The monitor then checks each position to see if it has reached the "Profit Target High" value. If the "Profit Target High Close" switch is on, it will close the position.
Profit Target Mid Trail: There is a toggle ("Profit Target Mid Trail Close") to close positions that trail "Profit Target Mid" by "Profit Target Mid Trail" (off by default). If a position is above the "Profit Target Mid" value, it will tag the position as "above profit target mid". On the next monitor interval, if the position trails "Profit Target Mid" by "Profit Target Mid Trail", it will be closed.
Exit Options: The user can set exit options to their preferences (default is a 300% stop loss).
Buttons:
There are also buttons for opening spreads manually (using the same min bid price logic from above) and a button to close positions tagged with "close now".
PDT:
This bot does NOT have PDT checks built in (but I'm sure they could be if someone wanted to). There will definitely be streaks where a lot of positions expire and won't count against your PDT total. But, this isn't guaranteed. So assume that it is NOT PDT friendly.