About this template
This bot is an evolution of this one: https://app.optionalpha.com/community/all/post/daily-shorts-3-day-rsi-trend
Intro:
I created this bot a few months ago while tweaking the bot referenced above. It had a pretty good track record but I wanted to see if I could improve on it. So I created a spreadsheet and tracked each trade that it made and then categorized them by position entry. I then spun off different bots with different entry criteria to see if I could find improvements.
For these new variations, I went through the SPY chart and took a best guess at what positions these new bots would have opened and filled in an estimated P/L. These guesstimates went from 9/19/22 - 4/24/23. Positions after 4/24/23 are actual results from the new paper bots that I created. There are 2 columns for each bot/variation: P/L and P/L if positions were held until expiration.
The spreadsheet is posted here, if anyone would like to take a look.
This bot has the settings of the far right column in the above spreadsheet, which had the best overall P/L of all the variations.
Here are some more details of how this bot works and descriptions of the scanner automation inputs and switches.
Determining Price Trend:
The bot tries to determine the short-term price trend of the ticker based on the following logic:
Extended uptrend: Ticker price has increased each of the past 2 days + intraday price has increased by Price Increase (%) (automation input)
Uptrend: Ticker price increased the prior day + intraday price has increased by Price Increase (%) (automation input)
Extended downtrend: Ticker price has decreased each of the past 2 days + intraday price has decreased by Price Decrease (%) (automation input)
Downtrend: Ticker price decreased the prior day + intraday price has decreased by Price Decrease (%) (automation input)
Curling up: Ticker price has decreased each of the past 2 days + intraday price has increased by Price Increase (%) (automation input)
Curling down: Ticker price has increased each of the past 2 days + intraday price has decreased by Price Decrease (%) (automation input)
Neutral: No price trend found over the past 2 days + current/intraday
Position Entry:
Positions are at least 7 DTE (customizable automation input).
SPS/SCS are set to -/+0.25 delta short leg, $5 wide wing (customizable automation inputs).
IC are set to -/+0.15 delta short legs, $5 wide wings (customizable automation inputs).
After determining the short-term trend, the bot will open different positions based on the scanner automation switch and input settings (please study these so you can identify them and adjust according to your preference). These are listed in order of precedence/scanner logic.
Extended uptrend:
- IC: Open IC in Extended Uptrend switch is on
- SPS: Open SPS in Extended Uptrend switch is on AND
RSI is below RSI Overbought (automation input) AND
((EMA 9 > EMA 20 AND Use EMA Extended Uptrend Filter switch is on) OR Use EMA Extended Uptrend Filter switch is off) AND
(Current time is 3:30 pm or later OR (Current time is 12:30 pm later AND Early Close switch is on) OR Open Positions Anytime switch is on
Uptrend:
- SPS: Open SPS in Uptrend switch is on AND
RSI is below RSI Overbought (automation input) AND
((EMA 9 > EMA 20 AND Use EMA Uptrend Filter switch is on) OR Use EMA Uptrend Filter switch is off)
- IC: Open IC in Uptrend switch is on
Extended downtrend:
- IC: Open IC in Extended Downtrend switch is on AND
(Current time is 3:30 pm or later OR (Current time is 12:30 pm later AND Early Close switch is on) OR Open Positions Anytime switch is on
- SCS: Open SCS in Extended Downtrend switch is on AND
RSI is above RSI Oversold (automation input)
Downtrend:
- SCS: Open SCS in Downtrend switch is on AND
RSI is above RSI Oversold (automation input) AND
((EMA 9 < EMA 20 AND Use EMA Downtrend Filter switch is on) OR Use EMA Downtrend Filter switch is off)
- IC: Open IC in Downtrend switch is on
Curling up:
- SPS: Open SPS on Curl Up switch is on AND
Previous 2 day price decrease > Price Decrease for Curl Up (%) (automation input)
Curling down:
- SCS: (Open SCS on Curl Down switch is on AND
Previous 2 day price increase > Price Increase for Curl Down (%) (automation input) AND
(Current time is 3:30 pm or later OR (Current time is 12:30 pm later AND Early Close switch is on) OR Open Positions Anytime switch is on)
OR
(Open SCS on RSI Overbought Curl Down switch is on AND
Previous day RSI > RSI Overbought (automation input) AND
(Current time is 3:30 pm or later OR (Current time is 12:30 pm later AND Early Close switch is on) OR Open Positions Anytime switch is on)
Neutral:
- IC: Intraday price has increased by Price Increase (%) (automation input) OR
Intraday price has decreased by Price Decrease (%) (automation input)
Updated Monitor to use Exit Options
Exiting Positions:
All values are customizable by setting the corresponding Exit Options, but these are the defaults.
Profit Taking:
Accelerated PT: Close positions that reach 60% profit if open for Accelerated PT Days Open market day or less (default is 1 market day).
PT High: Close positions at 75% profit if expiration is more than Reduced PT 1 DTE market days away (default is 2 market days). Uses a trail of 60%/15%, trail turns off below 45%.
If position return is below PT Nearing Expiration (%) (default is 45%),
Reduced PT 1: Close positions at 30% if expiration is Reduced PT 1 DTE market days away or less (default is 2 market days).
Reduced PT 2: Close positions at 20% if expiration is Reduced PT 2 DTE market days away or less (default is 1 market days).
PT Low: Close positions at 5% if expiration is PT Low DTE market day away or less (default is 0 market days).
Stop Loss:
The monitor has 2 toggles to control stop loss exits. One continuously checks for stop conditions (stop loss and breached strikes); the other only checks at the EOD (at 3:30 pm and after). Here are the default values.
Close positions at 200% stop loss if expiration is 1 market day away or less at EOD.
Close positions if short strike is breached and expiration is 1 market day away or less at EOD.
At Expiration:
The bot will attempt to close positions at 3:30 pm and after on expiration day, if:
Position return is < PT Expiration Close @ EOD (%) (default is 75%) OR
Short leg chance of ITM is > Chance of ITM Expiration Close @ EOD (%) (default is 15%) OR
Short leg OTM amount is < OTM Expiration Close @ EOD ($) (default is $2)
PDT:
This is a PDT safe bot (make sure Exit Options are set accordingly).
Allocation:
I started this bot with a $3000 allocation. It rarely exceeds 50-60% of allocation.