Wait X Trading Days After…
There are situation where you may NOT want to trade immediately when a specific market condition arises. Instead, you may want to wait X number of trading days after the market condition arises before placing a trade.
For example, instead of placing a trade right when the stock hits its 52-week high, you may want to wait 5 trading days after it hits its 52-week high before placing a trade.
Or you way want to wait 4 trading days after the 10-day Moving Average crosses above the 20-day Moving Average before placing a trade.
In this tutorial, we will explain how to construct a trading strategy that waits X trading days after a specific technical condition arises, before placing a trade.
Example
In this example, we will construct a trading strategy that waits 5 trading days after a 1 month high before selling a put.
- When the SPY hits a 1 month high (based on closing prices)
- wait 5 trading days
- then sell a 20-delta put
1-month High
Let’s construct the the “1-month closing price high” trading signal using the Rank study and the PriceClose study. The Rank study compares the current value with the highs / lows in the specified time frame, while the PriceClose study provides the daily closing price.
The “Rank of the PriceClose” compares the current closing price with the highs / lows closing prices in the specified time period. We will set the time period to 20, which corresponds to 20 trading days in 1-month.
When the Rank is 0, the current closing price is the lowest it has been in the past month (i.e. 1 month low). When the Rank is 100, the current closing price is the highest it has been in the past month. (i.e. 1 month high)
LookBack
When the 1-month closing price high is hit, we want to wait 5 trading days to enter our trade, instead of entering the trade right away.
We can accomplish this by using the LookBack study. The LookBack study will reference the state of a technical study X time periods ago.
By referencing the state of another study X time periods ago, we can enter a trade X trading days after the original condition is hit.
Wait X Days
In this scenario, we want to LookBack 5 trading days from the time the Rank of the PriceClose hit 100. (i.e. 5 trading days from the PriceHigh). And then sell a put at that time. This will effectively sell the put 5 trading days after the underlying stock hit a high.