5 5 48 3110.006 4l 28 24 46 Al 4 55 184 ~0.008 42 30 20 34 SI 7 52 890.010 50 29 \7 29 63 4 42 2470.012 49 28 15 31 62 3 51 39-0.014 50 50 0 13 75 13 63 80.016 60 20 20 20 80 0 40 50.018 67 0 33 33 67 0 =O 30.020 46 21 15 21 64 iS 69 39
 
396 
TABLE 15-6 (Continued)
 
 
 
 
 
 
 
Closing Price Trading Range Cont No.Cont Below Rev Cross Adj fr Cont Next of
Gap Dir Open Dir Prv Cls Open Only Day Cases
(e) Gold
5.000 52 39 7 23 75 2 66 444.500 47 35 18 29 7i 9 7I 174.000 57 35 9 22 70 4 43 233.500 68 24 4 24 72 4 52 253.000 50 340 13 38 50 13 56 322.500 42 40 18 40 56 2 44 552,000 55 24 20 38 ET 7 48 841.500 47 19 30 56 35 5 40 1781.000 52 14 30 61 27 9 44 3080.500 49 4 43 80 7 8 39 3340.000 0 0 0 0 0 9 0 1080.500 4 3 48 92 4 I 52 358—1,000 45 17 33 66 27 ! 53 326—1.500 42 29 25 53 4l 3 49 1972,000 37 34 26 45 St ! 55 4282.500 34 52 14 37 57 I 4l 863.000 43 43 15 25 74 2 54 6l3.500 38 43 17 38 55 2 64 424.000 25 63 13 38 63 0 44 164.500 44 39 \7 28 72 9 6l 185.000 44 53 3 7 90 3 53 59Closing Price Trading Range Cont No.Cont Below Rev Cross Adjfr Cont. == Next- of
Gap Dir Open Dir Pry Cis Open Only Day Cases
(f) Soybeans
10.000 37 30 14 23 60 17 59 709.000 63 19- 13 25 63 13 56 168.000 41 35 24 4l 4l 18 4l (77.000 53 29 18 35 4) 12 4t 176.000 52 18 25 34 52 14 48 445.000 52 15 27 38 47 13 53 604.000 52 25 20 49 40 8 42 1033.000 48 22 25 64 24 8 46 1582.000 44 9 40 72 16 7 45 2951.000 53 2 39 86 2 7 49 347
0 0 0 0 0 0 0 192
49 3 44 85 3 8 53 355
50 9 35 7 14 9 50 359
49 l6 34 60 24 0 54 12
53 23 21 49 36 12 46 $03
5} 18 26 46 33 15 31 39
53 28 19° 50 31 14 33 36
53 27 15 42 42 15 46 26
35 59 6 29 59 6 35 (745 27 18 27 64 9 55 in
62 17 13 19 59 22 57 63
 398 PATTERN RECOGNITION
 
1. “Cont Only” shows that the chance of the market continuing in the same direction,without a pullback, is extremely small; therefore, a market that gaps up and contin-ues higher should be sold, expecting prices to fall below the open. |
2. Except for sharply lower opens and quiet opens, there is a greater chance that theclosing price will continue the direction of the opening gap and a relatively smallchance that prices will reverse and close through the level of the prior closing price.This presents an opportunity to buy after a gap and a pullback. For example, ahigher gap of 60 points has a 91% chance of a pullback, only a 6% chance of a clos-ing reversal, and a 64% chance of a stronger close. A lower gap of 40 points has a77% chance of a rally above the open, a small chance of a close above yesterday’sclose, but only an equal chance of a weak close for the day.
3. The most extreme gaps, both higher and lower, are always interesting. For theDeutschemark there seems to be no bias in the pattern over the past 10 years. Noneof the extreme moves shows a tendency to continue in a predictable direction, butnone of them reversed on the close. This would indicate that extreme gaps do notmark the end of a move.
Some of the interesting features of the other markets in Table.15-6 are:
S&P 500
The percentage of time that S&P prices cross the previous closing price, or reverse direc-tion on the close, indicates that it has much more noise than Deutschemarks and mostother markets. A unique pattern of the S&P is that large upward gaps always trade lowerwhile large downward gaps have occasions when prices just:keep falling.
Treasury BondsThis market, as with the S&P has had an upward bias during the past 10 years; therefore,the symmetry of the patterns may be affected. For bonds it is interesting to view the smallgap open, for example .125 equal to %:. There is an 86% chance that prices will cross theprior close during trading, but a much smaller chance (38%) that prices will close lower.The 52% chance that prices will close above the open creates an opportunity for buying,provided risk can be controlled. _ -\Heating OilExpressed in cents per gallon (.020 is 2 cents), this study shows a large number of extremegaps exceeding 2 cents. When those gaps are higher there is a strong tendency to continueon the next open.
Soybeans -
The extremes of soybeans, as with some other markets, show a tendency to continue thenext day. Large gaps down are more likely to be consistently lower, while upward gaps areless consistent during the day.
’
Gap Study ProgramThe following Omega Easy Language program is easily converted to other programminglanguages. It can be used to evaluate gap opening of any market based on daily prices. Theresults are printed to a flat file called “gapout” stored in the Windows directory. Note thatthe results are given as the number of cases satisfying each condition rather than the per-centages seen in Table 15-6. To print the percentages, simply multiple the value by 100 anddivide by the number of total cases (ni tems) in the print statement.OPENING GAPS Al._ {NTRADAY PATTERNS 399
 
(SYSTEM: Gap Study}{Copyright 1978-1998. PJ Kaufman. All rights reserved.}Inputs: gapincr(0), nbars(20);vars:  ix(O}, n(O}, n2¢0), min(O), gapiO), ngap(O}, middle(O);arrays; maxmin(50](0), ccont[50](0), cbelow[50}(0), crev(50](0}, trcross({50}(0),tradj(50](0), trcont(50}(0}, ncont(50](0), nitems(50](0);(Initialize increments)if currentbar <= 1 then beginn= nbars + 1;n2 = @intportion(n/2);middle = n2 + 15min = -n2*gapiner;for ix = 1 to n beginmaxminCix] = min;min = min + gapincr;end;end;{Process gap}if open <> close[1] then begingap = {open - close[1])/gapincr;if gap > 0 then beginngap = @intportion(gap) + middle + 1;if ngap > n then ngap = n;end;if gap < 0 tnen beginngap = middie - 1 + @intportion(gap);(gap is negative}if ngap < 1 then ngap = 1;end; ~nitems(ngap] = nitems([ngapj + 1;{Relative position of today’s close}if (gap > 0 aad close > open) or (gap < 0 and close < open) thenccont(ngap] = ccont(ngap] + 1;if (gap > 0 and close > close[1] and close ¢ open) or(gap < 0 and close < close[1] and clase > open) thencbelow[ngap] = cbelow[ngap} + 1;if (gap > 0 and close < close{1J) or (gap < 0 and close > close[i]) thencrev[ngap] = crev[ngap] + 1;{Pattern of entire trading range}if (gap > 0 and low ¢ close[1]) or (gap < 0 and high > close[1]) thentrcross(ngap] = trcross[ngap] + 1;if (gap > 0 and low > close{1] and, low < open) or(gap < 0 and high < close[l] and high > open) thentradj(ngap] = tradj(ngap] + 1;if {gap > 0 and low >= open} or {gap < 0 and high <= open) thentrcont(ngap] = trcont(ngap] + 1;{Continue next day]if{gap[l] > 0 and open > close[1]) or(gap{1] < 0 and open < close[1}) then -ncont(ngap] = ncont(ngap] + 1;endelsenitems(middle] = nitems({middle} + 1;if lastcalcdate = date then beginfor ix =n downto 1 beginprint (file(*C:\windows\gapout"), maxmin[ix]:4:3, nitems(ix}:5:0,ccontlix]:5:0, cbelowlix]:4:0, crevlix}:4:0, trcrosslix]:5:0,tradjlix]:4:0, treontlix]:4 ncontlix}:5:6);end;
 
end:400 PATTERN RECOGNITION.
 
THREE STUDIES IN MARKET MOVEMENT—WEEKDAY, WEEKEND, ANDREVERSAL PATTERNS /
The next three sections are concerned with longer periods of time. The first, weekday pat-terns, looks only at the closing prices during a 5-day week from Monday through Friday tofind recurring close-only patterns. A week is often considered to have integrity as a single unitof time, and participants are accused of acting in the same way each week. This study attemptsto isolate predictive patterns; for example, if Monday through Thursday were all higher, whatis the possibility of Friday being higher? If the weekly trend can be clearly identified, should acorrection on Friday be expected due to evening-up (closing out positions before the week-end)? Because patterns represent human behavior, the results could prove interesting.
Weekend patterns are considered independently in the second study. The openingdirection on Monday could restore the trend of the prior week, if those traders who liqui-date on Friday intend to reset their positions. The weekend is also an extended period forunexpected news or a buildup of public interest. The study will attempt to relate the direc-tion of the Monday opening price to some pattern or trend of the preceding week.
Reversal patterns are not based on a day of the week but have often been discussed asa leading indicator. They may also be used as a filtering or timing device.
Weekday Patterns
During their constant exposure to the market, professional traders often observe patternsin weekly price movement; their acceptance of these patterns is as old as the market itself.In Reminiscences of a Stock Operator, the ficticnal character Larry Livingston (assumed tobe Jesse Livermore) begins his career recording prices on a chalkboard above the floor ofthe New York Stock Exchange, eventually becoming aware of patterns within these prices.The most accepted occurrence of a pattern is the Tuesday reversal, which is taken as com-monplace by close observers of the market. When questioned why a strong soybean mar-ket on the first of the week is followed by a weak day, a member of the Board of Tradewould shrug his shoulders and quote: “Up on Monday, down on Tuesday.” If this is true,there is a trading opportunity.
Ifa commonly accepted idea is not enough to be convincing, consider the additionalrationalization about human behavior: The weekend allows a buildup of sentiment, whichshould result in greater activity on Monday. Coupled with adding back positions that wereliquidated prior to the weekend, this may cause a disproportionate move on Monday, espe-cially early in the session. This pattern may be further exaggerated when a clear trendexists. With this overbought or oversold condition, it is likely that Tuesday would show anadjustment. So much for hypothesizing.
The first aspect of the test was to define the weekday pattern. This was done in terms ofthe Friday-to-Monday move (close-to-close). Monday always received the value X, regardlessof whether its direction from Friday was up or down. For each day that closed in the samedirection as the Friday-to-Monday move, another X is used; when the close reversed direc-tion, an O is recorded. Therefore, XOXXO means that Tuesday and Friday, represented by O,closed7in the opposite direction from the prior Friday-to-Monday move, while Wednesdayand Thursday were in the same direction. This could have meant either of the situations:
 
(i) (2)
Monday x Up DownTuesday O _ Down UpWednesday x Up Down ~Thursday x Up DownFriday oO Down UpTHREE STUDIES IN 1 ,ARKET MOVEMENT—-WEEKDAY, WEEKEND, AND REVERSAL PATTERNS 401
 
It might be that there is a distinction between the weeks that begin with an upwardmove on Monday rather than a lower price, but both cases were combined. This assumesthat the pattern, rather than the direction, is most important. It would also be reasonableto have assumed that the upward bias of the stock and interest rate markets during the past10 years would justify a separation of patterns according to their initial direction.
Daily Sequences
Figure 15-6 shows the aggregate results of the weekday patterns for a sampling of 23futures markets tested during the period 1976 through 1985, appearing in the previousedition of this book. The numbers next to the corresponding patterns indicate the per-centage of occurrences of each new day’s pattern. For example, if the Monday-Tuesday pat-tern was XX, indicating that prices moved the same direction, then there was a 58% chancethat an O followed, indicating a reversal.
Returning to the original premise for studying weekday patterns, we can use the broadset of market to see if any dominant behavior exists. We see that there was a 58% chance ofa reversal on Tuesday (XO) and a 53% chance of that reversal continuing into Wednesday(XOO). If a reversal did not occur on Tuesday, there was a 58% chance that it would occuron Wednesday (XOO). For a large number of tests, 58% shows a definite pattern that con-firms the original view. There are very few significant values that appear on Thursday, butthree patterns of interest appear on Friday—XOXXX, XOOXX, and XXOOX—showing57%, 64%, and 60%, respectively. These three patterns are important because they all showmidweek reversal and a continuation of the trend by the end of the week.
The weekday patterns for the same six markets studied in the previous section (“Open-ing Gaps”) were also tested for the period January 1986 through February 1996 and appear
 
FIGURE 15-6 23 futures markets, 1976-1985.
Monday Tuesday Wednesday Thursday Friday
XOXX 50XOXOX 50
+1 XOXO 50eeXOOXX 64
XOOX 50XOOXO 36XOO0OX 50
XOO0O0 50XOO000 50XXXXX 49
XXXX 53XXXXO 54XXXOX 47
| XXXO 47XXXOO 53XXOXX 54
ee
[xox 54] DONO aeXXOOX 60
>| XXOO 461 XXOOO 40
    
    
XOXXX 57
 
 
ie
 
 
ie
 
 
:402 PATTERN RECOGNITION
 
in Figure 15-7a-£ To understand the accuracy of these tests, each one includes approxi-mately 480 complete weeks of information used to compile the patterns; therefore, eachof the two combinations appearing on Tuesday have 240 entries, each pattern on Wednes-day represents 120 weeks, Thursday 60, and Friday 30, assuming an equal distribution ofpatterns. All of these markets are actively traded.
Looking first at the Deutschemarks (Figure 15-74), we see the same pattern as in the10 years prior. There is a 55% chance of a Tuesday reversal (XO) and a 58% chance of aWednesday reversal (XXO). If a reversal does not occur by Wednesday, there is a 57%chance of a reversal on Thursday (XXXO), but only a 28% chance that a reversal will occuron Friday (XXXXO), if it hasn’t yet happened. The reverse situation shows that, if pricesmoved in the same direction Monday through Thursday, then there was a 72% chance theywould move in that direction on Friday.
The same pattern seen in Deutschemarks is also apparent in the S&P (Figure 15-75),where the chance of a reversal is 56%, 54%, 62%, and 38%. The most dominant Friday pat-tern is a trend continuation following a similar day on Thursday (XXXXX and XXOXX).Treasury bonds (Figure 15-7c) show a slightly greater consistency for reversal—57%, 59%,55%, and 53%. For bonds, the chance of continuing in the same direction for the entireweek is small. Gold (Figure 15-7e) also reflects similar reversal patterns—59%, 55%, 58%,and 38%, In view of the steady downtrend in gold prices during this 10-year period, thispattern appears to show a consistent method in the behavior of the traders. Soybeans (Fig-
 
FIGURE 15-7 Weekday study results. (a) Deutschemarks. (b) S&P 500. (c) Treasury bonds.(d) Heating oil. (e) Goid. (f) Soybeans.
Monday Tuesday Wednesday Thursday Friday
 
 
XO) 49XOXXO 51
       
ROOXX 4800)pr Leox_ 97] XOOXO 52
   
[aor wee
 
 
XXOXO 48XXOOX 42
. L+|xx00 51— XXOO0 58
(a) DeutschemarksTHREE STUDIES IN MARKET MOVEMENT—WEEKDAY, WEEKEND, AND REVERSAL PATTERNS 403
 
 
FIGURE 15-7 (Continued)
 
Monday Tuesday Wednesday Thursday Friday
Leow
 
         
XOXXX 52
                     
XOXXO 48
  
XOXOX 56
 
XOXOO 44
XOOXX 48XOOX 54
XOOXO 52
XOO0OX 50xO000 49
X0000 50
eH
XXXOO 48
XXOXX 60XXOX 43XXOXO 40
 
 
 
(b) S& P500
 
ure 15-7f), a market clearly out of the financial circle, show their reversal tendency as 56%,58%, 59%, and 58%. This variation on Friday does not change the uniform market reversalpattern seen early in the week. °
Heating oil patterns (Figure 15-7) are noticeably different from the other five mar-kets. There seems to be no dominant pattern on Tuesdays and Wednesdays and only minorseparation on Thursday. The three best patterns on Thursday, XOXO, XXXO, and XXOO,all show that Thursday moves in the direction opposite to Monday. The three best patternson Friday, XOOXO, XXXOO, and XXOXO, also show that Fridays reverse from the openingMonday direction. After seeing the consistency of the other markets, these patterns indi-cate a very different participation. We might speculate that midweek release of oil stocks bythe API, combined with weekend news about OPEC, have a tendency to create differentreactions from traders.
Trading Weekday Patterns
The persistence of the weekday reversal over the past 20 years appears to be based on thenature of market participation. The patterns span nearly all markets with very similarresults. To trade these weekday patterns, positions must be entered on the close of theprior day. Therefore, if soybeans move higher on Monday and Tuesday, we set a short onTuesday’s close with a 58% chance of a profit on Wednesday. If that does not occur, we canhold that short with a 59% chance of recovering at least some of that loss on Thursday. IfWednesday proved profitable, neither Thursday nor Friday have interesting patterns andwe would close out the trade.404 PATTERN RECOGNITION
 
 
FIGURE 15-7 (Continued)
 
Monday Tuesday Wednesday Thursday Friday
 
 
 
(©) Treasury bonds
 
In many cases, if you are trading the reversal pattern and it does not occur on the firstday, it is best to hold that position at least one more day. This study may be taken furtherby looking at whether the open of the next day is a better point to enter a reversal tradethan the previous close. Therefore, if Monday and Tuesday were both lower, a long enteredon the open Wednesday may prove more profitable and less risky.
Programming the Weekday Study
The following program will produce results forthe weekday study in the Printer Log win-
“dow of TradeStation. There are a number of different methods that could be used to findthese patterns; this approach is shown because it is transparent without using an excessiveamount of programming code. o
(SYSTEM: Weekday Study}{Copyright 1985-1998. PJ Kaufman. All rights reserved.) oe{Update weekday study in "Trading Systems and Methods")oo vars: dow(0), dir(0), ix(0),4y(0), error(0), Mon(0), day2(0), day3(0), day4¢0,day5(0),div(0), pe(0);arrays:Tues(2](0), Wed(4}(0), Thurs(8J(0), Fri(16](0), pattern[Sj(0),n2C2}{0), n304)(0), n4(8](0), n5(16](0);(create full pattern for week before entered values in case incomplete)dow = @dayofweek(date);if currentbar ~ 1 then beginTues(1) = 10; Tues(2) = 11;THREE STUDIES IN MARKET MOVEMENT—WEEKDAY, WEEKEND, AND REVERSAL PATTERNS 405
 
 
FIGURE [5-7 (Continued)
Monday Tuesday Wednesday Thursday Friday
 
XOXXX 58
XOXOX 49
XOOXX 38
 
XOOOX 54L poco wf 00xXO000 46{ XXXXX 49[xxx 45] 45XXXXO 51XXXOX 35Ls] XXXO 55
XXXOO 65
 
   
XXOXX 38XXOXO 62XXOOX 45
r>Lx0x_ 45}
      
 
 
 
(d) Heating oif
 
Wed(1] = 101; Wed(2] = 100; Wed[3} = 111; Wed([4] = 110;Thurs{ij = 1011; Thurs{2] = 1010; Thurs(3] = 1001; Thurs[4j = 1000;Thurs(S} = 1111; Thurs(6] = i110; Thurs(7j = 1101; Thurs(8j = 1100;Fri{1] = 10111; FriC2] = 10120; Fri(3] = 10101; Fri[4] = 10100;Fri(S} = 10012; Frif6} = 10010; Frif7] = 10001; Fri[8] = 10000;Fri(9j = 11241; FriCiO} = 11110; Frifid] = 11101; FriCl2] = 11100;Fri(13} = 11012; FriCl4] = 11010; FriCiS] ~ 11001; Frifl6] = 11000;end;(Monday)if dow ~ 1 then beginfor ix = 1 to 5 beginpattern[ix] = 0;end;if close > close{1] then pattern(1] = 1 else pattern(1] = -1;end; _
(Tuesday)if dow ~ 2 then begin
if close > close[1] then pattern{2] = 1 else pattern(2] ~ -1;
end;
(Wednesday)
if dow = 3 then beginif close > close[1] then pattern(3] = 1 else pattern[3] = -1;_end; :
{Thursday}if dow = 4 then begin406 PATTERN RECOGNITION
 
 
FIGURE [5-7 (Continued)
 
Monday Tuesday Wednesday Thursday Friday
XOXXO 46
     
XOXO 60
       
 
(@) Gold
 
if close > close{i] then pattern[4] = 1 else pattern[4] = -1;end; -(Friday)if dow = 5 then begin -if close > close{l] then pattern{5] = 1 else pattern(5) = -1;error = 0;{process pattern for entire week, convert to pattern beginning with 1)for ix = 2 to S beginif pattern[ix] = 0 then error = 1;if error ~ Q then beginif pattern(ix} * pattern{i] > 0 then patternlix] = 1 else_ pattern[ix] ~ 0;
- end;
end; _pattern[1] = 1; 7if error = 0 then begin eT
(create a vaiue for each day)Mon = Mon + 1;oay2 = 10 + patternl2];day3 = 100 + pattern(2]*10 + pattern(3];day4 = 1600 + pattern{[2]*100 + pattern[3]*10 + pattern[4];dayS = 10000 + pattern(2J*1000 + pattern(3]*100 + pattern[4j*10 +pattern(5];{match each pattern and add to number of cases}if day2 = Tues(1) then n2(1) = n2f1] + 1 else n2{2] = n2(2] + 1;for ix = 1 to 4 beginTHREE STUDIES IN MaRKET MOVEMENT—WEEKDAY, WEEKEND, AND REVERSAL PATTERNS 407——  ——_ —
 
FIGURE 15-7 (Continued)
 
Monday Tuesday Wednesday Thursday Friday
 
       
   
XOXXX 59
    
XOX 51
 
 
 
(f) Soybeans
 
if day3 = Wed[ix] then n3Cix] = n3[ix] + 1;end;
for ix = i to 8 beginif day4 = ThursCix] then n4(ix] = n4{ix} + 1;end;
for ix = 1 to 16 beginif dayS = Frilix] then n5Cix] = nS(ix] + 2;end;
end;end;if lastcalcdate = date then begin _print (“Monday = i 100%, cases =", mon:5:0);print ("Tuesday");for ix = 1 to 2 begindiv = @intportion((ixt1}/2);pe = n2[ixj*100/Mon;print (Tueslix]:5:0, n2fix]:4:0, pe:4:0);end;print ("Wednesday");for ix = 1 to 4 begindiv = @intportion( (ix