About this template
Quick Start Guide
I get it because I am the same way too. You will eventually read the documentation, but right now you just want to deploy the bot. The Quick Start Guide section is at the top of the documentation for that very reason.
To get started, do the following to an existing bot.
- Make sure your existing bot’s tags do not collide with the roll manager tags
- Ideally, change the tags on your bot
- A complete list of tags used (bot and position) is listed below
- Remove the test scanner automation
- This is only for testing the roll logic and it opens many positions likely to roll
- Leave it in place for a paper trading bot to see how positions roll
- Add only one daily new max XX bot tag to your bot in order to set a limit on the number of daily new positions
- For one daily new position, set the daily new max 01 bot tag
- For two daily new positions, set the daily new max 02 bot tag, and so on
- Alternatively, let the Adjust Daily New Max XX at Market Close automation set it for you each day
- Set both Daily Positions and Position Limit on the bot to 10
- Throttle your scanner by looking for the bot tag daily max met to be unset
- Once this tag is set each day, the bot should stop opening positions
- Make sure your scanner tags all new positions with the new position tag
- Add the nine automations with the appropriate schedule
- Adjust any automation inputs to your liking
- Run your modified bot in paper trading first to make sure it is working correctly for rolling positions
Enjoy!
Introduction
The roll manager is a set of automations, inputs, and tags that can be added to existing bots in order to roll problem spreads into the future. This documentation contains the following sections.
- Quick Start Guide
- Minimal steps to get started immediately
- Introduction
- What you are reading now
- Conventions
- Typographical conventions of this document
- Rationale
- Describes the reason for building the roll manager
- Architecture
- Functional overview of the automations
- Automations
- Automations that comprise the roll manager
- Bot Tags
- Bot tags read and modified by the roll manager
- Position Tags
- Position tags read and modified by the roll manager
- Caveats
- Discussion of known warnings and limitations with the roll manager
Conventions
Tag names are italicized.
Rationale
Accepting the random walk hypothesis, the price of an underlying security moves up and down randomly, making it inevitable that some short spreads will expire or incur losses at an inopportune time. The random walk hypothesis also implies that a problem spread will likely recover losses eventually, given enough time. The solution to a problem spread then is to get more time for it to recover, either partially or fully. Rolling a problem spread into the future provides more time for the spread to recover while adding additional extrinsic value. In general, extrinsic value decays fastest closest to expiration, suggesting that the most profitable approach is to write short spreads close to expiration, profiting from those that move favorably while rolling unfavorable spreads into the future repeatedly until they become profitable. The roll manager makes this possible with minimal changes to an existing bot.
A short spread makes money when the value of the spread has decreased to a level where the position is exited for a sufficient profit. When this happens, everything is fine and there is no need for the roll manager.
There are several other scenarios that may happen with a short spread, requiring the use of the roll manager.
- A new position does not gain nor lose much money before expiration
- At expiration, roll the spread into the future, pocketing the additional premium
- The underlying price moves so far as to approach the long strike price
- Roll the spread into the future, move the long strike, and potentially move the short strike closer to the underlying price
- Configured correctly, the premium collected offsets the potential gain loss of moving the short strike price
- When the short strike is ITM, the underlying price and short strike do not converge
- At expiration, roll the spread into the future and potentially move the short strike closer to the underlying price
- Configured correctly, the premium collected offsets the potential gain loss of moving the short strike price
The roll manager will handle all of the above scenarios: gaining more time, moving out the long strike, and slowly moving the short strike closer to the underlying price. The Nudge Short Strike switch tells the Roll Tagged Positions at Market Open animation to move the short strike when rolling challenged spreads.
Architecture
The roll manager has nine automations to identify positions needing to be rolled, rolling those positions, providing tags for the scanner to know when it has met its daily max, housekeeping, and reporting.
Several constraints drove the architectural decisions.
- Option Alpha does not have a graceful way to limit bot new positions separate from rolled positions
- Option Alpha counts both new and rolled positions all as new.
- Automations cannot merge execution paths from multiple decisions.
- Each decision creates an additional execution path. Multiple decisions result in multiple execution paths. Any action after decisions that must take place regardless of the decision will need to be duplicated across all execution paths, resulting in complex automations prone to bugs.
- The solution to the above constraint is to sequence automations, but it is unclear how to ensure execution sequence for multiple automations with the same schedule.
- Decision recipes do not cover all scenarios.
- For example, there is no way to have a decision that decides, “Is the number of new (not rolled) positions today less than or equal to the number of maximum new positions that the user has specified?”
- A roll manager requirement was to provide a simple mechanism to throttle new positions in the bot scanner.
- A roll manager requirement was to ensure that if the number of rolled positions and new positions exceeded the bot daily maximum, the rolls would take priority.
As a result of the above constraints, the following architectural choices drove the design of the roll manager.
- Identification of which positions to roll takes place separate from the roll itself because combining those capabilities makes for complex automations.
- Identification of which positions to roll takes place at Market Close.
- The act of rolling takes place at Market Open before new positions are opened.
- Two automations conspire to set or clear the bot tag daily max met which the scanner can use to throttle new daily positions.
Automations
The following automations are part of the roll manager.
- Adjust Daily New Max XX at Market Close
- Calc Daily Max Met
- Calc New Positions Today on Each New Position Open
- Clear New Position Tags at Market Open
- Report Long Leg Delta
- Report Short Leg Delta
- Roll Tagged Positions at Market Open
- Tag Roll 0 DTE at Market Close
- Tag Roll Long Threatened at Market Close
Each automation is described in terms of:
- Purpose
- Schedule
- Inputs
Adjust Daily New Max XX at Market Close
Purpose
This automation sets adjusts the daily new max XX bot tag based on how many positions the bot has open.
Schedule
This automation is run once at Market Close.
Inputs
The following inputs control the automation behavior.
- Adjust Daily New Max
- When this switch is set to On, the automation will adjust the daily new max XX tags to set a tag according to the number of open positions
- When this switch is set to Off, the daily new max XX tag is not altered
Calc Daily Max Met
Purpose
This automation sets the daily max met bot tag when the bot has opened the maximum number of new positions specified by the input tags.
NOTE: this automation has a potential race condition. See Caveats below.
Schedule
This automation is scheduled as a Monitor to be run every 15 minutes throughout the trading day.
Inputs
This automation has no inputs.
Calc New Positions Today on Each New Position Open
Purpose
This automation sets only one daily new XX bot tag according to the number of positions opened today that are tagged as new.
If the bot has opened zero new positions today, the automation will set the following bot tags.
- daily new 00
If the bot has opened one new position today, the automation will set the following bot tags.
- daily new 01
If the bot has opened two new positions today, the automation will set the following bot tags.
- daily new 02
And so on, up to the following maximum.
If the bot has opened ten new positions today, the automation will set the following bot tags.
- daily new 10
NOTE: this automation has a potential race condition. See Caveats below.
Schedule
This automation is run whenever a new position is opened.
Inputs
This automation has no inputs.
Clear New Position Tags at Market Open
Purpose
This automation clears and sets bot tags for the trading day.
Schedule
This automation is run once at Market Open.
Inputs
This automation has no inputs.
Report Long Leg Delta
Purpose
This automation does nothing other than put in the automation log the long option delta of all short spread positions.
Schedule
This automation is triggered manually by a button.
Inputs
This automation has no inputs.
Report Short Leg Delta
Purpose
This automation does nothing other than put in the automation log the short option delta of all short spread positions.
Schedule
This automation is triggered manually by a button.
Inputs
This automation has no inputs.
Roll Tagged Positions at Market Open
Purpose
This automation rolls positions tagged as needing a roll. Specifically, it closes tagged positions then opens a similar position with a future expiration date.
Schedule
This automation is run once at Market Open. The reason for running at Market Open is in case the total new and rolled positions exceeds the maximum for the bot (10 total positions at the time of writing), the rolling positions should have precedence. Running this automation at Market Open ensures that the all rolls will take place before the bot attempts to open new positions.
Inputs
The following inputs control the automation behavior.
- Roll Expiration
- This controls the expiration date of the position opened from the roll
- Roll Exit Options
- This sets the Exit Options of the position opened from the roll
- Nudge Short Strike
- When this switch is set to On during a threatened roll, move the short strike one step closer to current security price
- Short Call Deep ITM Delta
- This number indicates the minimum short call delta of a deep ITM position, defaulted to 0.7
- Set this to 1 to disable nudging the short call at expiration
- Note that Option Alpha reports short call delta as positive, while others calculate it as negative
- Short Put Deep ITM Delta
- This number indicates the maximum short put delta of a deep ITM position, defaulted to -0.7
- Set this to -1 to disable nudging the short put at expiration
- Note that Option Alpha reports short put delta as negative, while others calculate it as positive
Tag Roll 0 DTE at Market Close
Purpose
This automation tags positions that will expire in the next trading session.
Schedule
This automation is run once at Market Close.
Inputs
This automation has no inputs.
Tag Roll Long Threatened at Market Close
Purpose
This automation tags positions where the underlying security price is approaching strike price of the long option.
Schedule
This automation is run once at Market Close.
Inputs
The following inputs control the automation behavior.
- Long Call Threatened Delta
- This number indicates the minimum long call delta of a threatened position, defaulted to 0.3
- Long Put Threatened Delta
- This number indicates the maximum long put delta of a threatened position, defaulted to -0.3
Bot Tags
Bot tags are set to maintain state of the bot itself. Each tag is listed with a description of its meaning and a list of what automation reads the tag and what modifies the tag.
daily max met
This tag is set when the bot has opened the maximum amount of new positions today.
Read by
- Calc Tag Daily Max Met
- Your bot scanner (not included with the roll manager)
Modified by
- Calc Tag Daily Max Met
- Clear New Position Tags at Market Open
daily min met
This tag is set when the bot has opened at least one position today.
Read by
- None
Modified by
- Calc New Positions Today on Each New Position Open
- Clear New Position Tags at Market Open
daily new XX
This is a set of tags set and read by the bot to track the number of new positions that the bot has opened today. Each tag implies that the bot has opened exactly number of new positions. Only one of the below tags should be set at any moment in time.
- daily new 00
- daily new 01
- daily new 02
- daily new 03
- daily new 04
- daily new 05
- daily new 06
- daily new 07
- daily new 08
- daily new 09
- daily new 10
Read by
- Calc Tag Daily Max Met
- Calc New Positions Today on Each New Position Open
Modified by
- Calc New Positions Today on Each New Position Open
- Clear New Position Tags at Market Open
daily new max XX
This is a set of tags set by the user to define the maximum number of daily new positions the bot may open. Only one tag should be set for the bot at a time. The full list of available tags in the set is below.
- daily new max 00
- daily new max 01
- daily new max 02
- daily new max 03
- daily new max 04
- daily new max 05
- daily new max 06
- daily new max 07
- daily new max 08
- daily new max 09
- daily new max 10
Read by
- Calc Tag Daily Max Met
Modified by
- One and only one tag from this set should be set by the user to indicate the maximum number of new positions the bot may open each day
- Adjust Daily New Max XX at Market Close dynamically alters these tags when the Adjust Daily New Max switch is set to On
Position Tags
Position tags are set to maintain state of each position. Each tag is listed with a description of its meaning and a list of what automation reads the tag and what modifies the tag.
closed to roll
This tag indicates that the position has been closed by a roll operation.
Read by
- Nothing in the roll manager
Modified by
- Roll Tagged Positions at Market Open
new
This tag is placed on new positions opened by the scanner, in contrast to positions opened by the roll manager.
Read by
- Calc New Positions Today on Each New Position Open
Modified by
- Your bot scanner (not included with the roll manager)
- Note that your bot scanner must place the new tag on all new positions
opened from roll
This tag indicates that the position has been opened by a roll operation.
Read by
- Nothing in the roll manager
Modified by
- Roll Tagged Positions at Market Open
roll 0 dte
This tag indicates that the position will expire in the next trading session.
Read by
- Roll Tagged Positions at Market Open
Modified by
- Tag Roll 0 DTE at Market Close
roll long threatened
This tag indicates that the position has a threatened long option.
Read by
- Roll Tagged Positions at Market Open
Modified by
- Tag Roll Long Threatened at Market Close
roll manual
This tag will cause the next roll operation to roll this position.
Read by
- Roll Tagged Positions at Market Open
Modified by
- The user applies this tag to a position to force that position to roll
short strike nudged
This tag indicates that the position has been opened by a roll operation and the short strike has been moved closer to the underlying strike price.
Read by
- Nothing in the roll manager
Modified by
- Roll Tagged Positions at Market Open
Caveats
Race conditions are where errors appear when operations do not take place in the expected sequence. As the developer of the roll manager, I have yet to witness a race condition manifest, but since the possibility exists, they are discussed here. There are at least two automations with potential race conditions.
- Calc New Positions Today on Each New Position Open
- Calc Daily Max Met
Both of the above are intended to work together to maintain the daily max met bot tag. It is conceivable that this tag might not be set correctly, resulting in the scanner either failing to open a position when it is able or opening too many positions. The reasons for the potential race conditions are listed below.
The Calc New Positions Today on Each New Position Open automation is run after a new position is opened. This automation iterates all positions tagged new and counts them, storing the result in the daily new XX bot tags. As far as I am aware, there are no guarantees that only one instance of the automation will run at a time.
- If multiple copies run at the same time (because the bot has opened multiple positions in quick succession), then it could happen that multiple running instances are each setting and resetting the bot tags while the other instances are running.
- This will create a mess of the tags that will get cleaned up the next time the automation is run.
The Calc Daily Max Met automation takes the results of the above automation to set the daily max met bot tag. As far as I am aware, there are no guarantees that:
- This automation will run when the above automation is not running
- If this automation runs while the above automation is still running, then this automation will have inconsistent bot tags for its logic, setting the daily max met bot tag incorrectly.
- This automation will run before the scanner runs
- If the scanner runs while this automation is running, then the scanner may reference an invalid value for the daly max met bot tag.
As noted, so far the race conditions have not manifested and may never manifest. If race conditions do manifest, then the roll manager will need to be updated to ensure that it is parallel-safe.
The Nudge Short Strike switch could cause the bot to lock in losses. Use this switch with caution.
Let me add one final note. Not only is it possible that the roll manager has bugs, it is likely that the roll manager has bugs. Deploy this in a paper-trading bot before putting it into a live bot.
Limitations
The roll manager has several limitations.
- This only manages short spreads.
- Rolling trades eats capital for potentially long time periods; make sure that you have sufficient capital to ride out a reversal.
- The roll manager logic will fail unless your scanner puts the new tag on opened positions.