Automated scanning for entries and position monitoring for exits.
Hybrid, semi-automated strategy
Uses custom buttons and actions alongside bot automations.
Trade paper or real money
Try risk-free paper trading or connect your brokerage account to trade live.
Setup to trade the following strategies
Manages multiple ticker symbols
Trades a basket of tickers you choose to automate diversification
Focused trading in one ticker
Trades multiple positions in one ticker for targeted customization.
No coding required, 100% customizable
You can easily modify this bot template to fit your exact needs or trading style.
About this template
The original Trendy Short Put Spread bot was designed to have only a single put credit spread open at any time. There could also be a hedging call credit spread opened under the right conditions. The bot is limited to one of each spread type by the bot's position limit settings and the logic of the scanner and hedging monitor.
If one is good then more is better, right?
How can this be extended to allow more Trendiness?
I want the bot to...
- handle 5 short put spreads, plus a potential hedge spread for each. 10 total positions.
- have hedges that match up with the put spread that triggered their opening.
- be robust and handle no-fills for orders and retry if needed.
- limit itself to one new short put spread per day.
To accomplish this, I have 5 virtual "slots" to which positions are assigned. Each slot can hold one each of put and call credit spreads. The slots can be assigned and released in any order as positions are entered and exited. This "slots" approach is critical to ensuring the call hedges match their put positions and over-hedging is avoided. Prior ideas from Ensuring Multi-Part Positions Get Filled are at work here with tags used heavily.
Tags "pcs1, pcs2, ..." and "ccs1, ccs2, ..." mark positions with their assigned slot. When a slot is in use, these tags are applied to the bot as well.
The Short Put Spread Scanner w/ Trend Filter has a series of test/open combinations like this.
The tag test ensures the slot is free, then the new short put spread is opened and assigned to that slot. However, we can't be sure the order will fill, so we don't apply the tag to the bot just yet. That is handled by the PCS opened event automation. The opening has succeeded if the position arrives here. Then the "justopened" tag is removed from the position and the slot tag is applied to the bot.
When the Short Put Spread Hedge monitor finds conditions right for a short call spread it identifies the put spread's slot, then opens the hedge position only if there is not one already in place for this put spread.
For hedges, the CCS opened event automation receives confirmation of the fill and tags the bot.
To limit the bot to one new short put spread per day the PCS opened event automation sets a "pcsopenedtoday" tag on the bot when it gets a fill confirmation. If the scanner sees this, it will not open any more new positions.
To allow new short put spreads the next trading day, the Clear PCS Opened Tag automation runs as a 9:40 market open event to reset the tag.
When positions are closed, they get tagged with "closing". This allows the Cleanup Closes monitor to retry the close if it does not get filled right away.
This bot will not allow fully OTM spreads to go through expiration. Doing so would leave the tags in a messy state and require manual clean up. OTM spreads will start attempting to close after 3:00 PM on expiration day.
The one hazard for this bot is early assignment of positions. Just like any bot with an early assignment, the position will need to be overriden from the Positions tab, and the appropriate slot tags will need to be removed from the bot.
Learn more about the options strategies this template could trade: