Complete Strategy based on Sheldon Knight and William Brower Research
In my Easing Into EasyLanguage: Hi-Res Edition, I discuss the famous statistician and trader Sheldon Knight and his K-DATA Time Line. This time line enumerated each day of the year using the following nomenclature:
First Monday in December = 1stMonDec
Second Friday in April = 2ndFriApr
Third Wednesday in March = 3rdWedMar
This enumeration or encoding was used to determine if a certain week of the month and the day of week held any seasonality tendencies. If you trade index futures you are probably familiar with Triple Witching Days.
Four times a year, contracts for stock options, stock index options, and stock index futures all expire on the same day, resulting in much higher volumes and price volatility. While the stock market may seem foreign and complicated to many people, it is definitely not “witchy”, however, it does have what is known as “triple witching days.”
Triple witching, typically, occurs on the third Friday of the last month in the quarter. That means the third Friday in March, June, September, and December. In 2022, triple witching Friday are March 18, June 17, September 16, and December 16
Other days of certain months also carry significance. Some days, such as the first Friday of every month (employment situation), carry even more significance. In 1996, Bill Brower wrote an excellent article in Technical Analysis of Stocks and Commodities. The title of the article was The S&P 500 Seasonal Day Trade. In this article, Bill devised 8 very simple day trade patterns and then filtered them with the Day of Week in Month. Here are the eight patterns as he laid them out in the article.
- Pattern 1: If tomorrow’s open minus 30 points is greater than today’s close, then buy at market.
- Pattern 2: If tomorrow’s open plus 30 points is less than today’s close, then buy at market.
- Pattern 3: If tomorrow’s open minus 30 points is greater than today’s close, then sell short at market.
- Pattern 4: If tomorrow’s open plus 30 points is less than today’s close, then sell short at market.
- Pattern 5: If tomorrow’s open plus 10 points is less than today’s low, then buy at market.
- Pattern 6: If tomorrow’s open minus 20 points is greater than today’s high, then sell short at today’s close stop.
- Pattern 7: If tomorrow’s open minus 40 points is greater than today’s close, then buy at today’s low limit.
- Pattern 8: If tomorrow’s open plus 70 points is less than today’s close, then sell short at today’s high limit.
This article was written nearly 27 years ago when 30 points meant something in the S&P futures contract. The S&P was trading around the 600.00 level. Today the e-mini S&P 500 (big S&P replacement) is trading near 4000.00 and has been higher. So 30, 40 or 70 points doesn’t make sense. To bring the patterns up to date, I decided to use a percentage of ATR in place of a single point. If today’s range equals 112.00 handles or in terms of points 11200 and we use 5%, then the basis would equate to 11200 = 560 points or 5.6 handles. In the day of the article the range was around 6 handles or 600 points. So. I think using 1% or 5% of ATR could replace Bill’s point values. Bill’s syntax was a little different than the way I would have described the patterns. I would have used this language to describe Pattern1 – If tomorrow’s open is greater than today’s close plus 30 points, then buy at market – its easy to see we are looking for a gap open greater than 30 points here. Remember there is more than one way to program an idea. Let’s stick with Bills syntax.
- 10 points = 1 X (Mult) X ATR
- 20 points = 2 X (Mult) X ATR
- 30 points = 3 X (Mult) X ATR
- 40 points = 4 X (Mult) X ATR
- 50 points = 5 X (Mult) X ATR
- 70 points =7 X (Mult) X ATR
We can play around with the Mult to see if we can simulate similar levels back in 1996.
William Brower’s DoWInMonth Enumeration
The Day of Week In A Month is represented by a two digit number. The first digit is the week rank and the second number is day of the week. I thought this to be very clever, so I decided to program it. I approached it from a couple of different angles and I actually coded an encoding method that included the week rank, day of week, and month (1stWedJan) in my Hi-Res Edition. Bill’s version didn’t need to be as sophisticated and since I decided to use TradeStation’s optimization capabilities I didn’t need to create a data structure to store any data. Take a look at the code and see if it makes a little bit of sense.
NewMonth is set to false on every bar. If tomorrow’s day of month is less than today’s day of month, then we know we have a new month and newMonth is set to true. If we have a new month, then several things take place: reinitialize the code that counts the number Mondays, Tuesdays, Wednesdays, Thursdays and Fridays to 0 (not used for this application but can be used later,) and set the week count weekCnt to 1. If its not a new month and the day of week of tomorrow is less than the day of the week today (Monday = 1 and Friday = 5, if tomorrow is less than today (1 < 5)) then we must have a new week on tomorrow’s bar. To encode the day of week in month as a two digit number is quite easy – just multiply the week rank (or count) by 10 and add the day of week (1-Monday, 2-Tuesday,…) So the third Wednesday would be equal to 3X10+3 or 33.
Use Optimization to Step Through 8 Patterns and 25 Day of Week in Month Enumerations
Stepping through the 8 patterns is a no brainer. However, stepping through the 25 possible DowInAMonth codes or enumerations is another story. Many times you can use an equation based on the iterative process of going from 1 to 25. I played around with this using the modulus function, but decided to use the Switch-Case construct instead. This is a perfect example of replacing math with computer code. Check this out.
Here we are switching on the input (dowInMonthInc). Remember this value will go from 1 to 25 in increments of 1. What is really neat about EasyLanguage’s implementation of the Switch-Case is that it can handle ranges. If the dowInMonthInc turns out to be 4 it will fall within the first case block (case 1 to 5). Here we know that if this value is less than 6, then we are in the first week so I set the first number in the two digit dayOfWeekInMonth representation to 1. This is accomplished by setting value3 to 10. Now you need to extract the day of the week from the 1 to 25 loop. If the dowInMonthInc is less than 6, then all you need to do is use the modulus function and the value 6.
- mod(1,6) = 1
- mod(2,6) = 2
- mod(3,6) = 3
This works great when the increment value is less than 6. Remember:
- 1 –> 11 (first Monday)
- 2 –> 12 (first Tuesday)
- 3 –> 13 (first Wednesday)
- …
- …
- 6 –> 21 (second Monday)
- 7 –> 22 (second Tuesday).
So, you have to get a little creative with your code. Assume the iterative value is 8. We need to get 8 to equal 23 (second Wednesday). This value falls into the second case, so Value3 = 20 the second week of the month. That is easy enough. Now we need to extract the day of week – remember this is just one solution, I guarantee there are are many.
mod(dowInMonthInc – 5, 6) – does it work?
value2 = mod(8-5,6) = 3 -> value3 = value1 + value2 -> value3 = 23. It worked. Do you see the pattern below.
- case 6 to 10 – mod(dowInMonthInc – 5, 6)
- case 11 to 15 – mod(dowInMonthInc – 10, 6)
- case 16 to 20- mod(dowInMonthInc – 15, 6)
- case 21 to25 – mod(dowInMonthInc – 20, 6)
Save Optimization Report as Text and Open with Excel
Here are the settings that I used to create the following report. If you do the math that is a total of 200 iterations.
I opened the Optimization Report and saved as text. Excel had no problem opening it.
I created the third column by translating the second column into our week of month and day of week vernacular. These results were applied to 20 years of ES.D (day session data.) The best result was Pattern #3 applied to the third Friday of the month (35.) Remember the 15th DowInMonthInc equals the third (3) Friday (5). The top patterns predominately occurred on a Thursday or Friday.
Here is the complete code for you to play with.
I think this could provide a means to much more in-depth analysis. I think the Patterns could be changed up. I would like to thank William (Bill) Brower for his excellent article, The S&P Seasonal Day Trade in Stocks and Commodities, August 1996 Issue, V.14:7 (333-337). The article is copyright by Technical Analysis Inc. For those not familiar with Stocks and Commodities check them out at https://store.traders.com/
Please email me with any questions or anything I just got plain wrong. George
Discover more from George Pruitt
Subscribe to get the latest posts sent to your email.