0% found this document useful (0 votes)
146 views6 pages

36-The Random Walk Revealed

Uploaded by

Fetog
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
146 views6 pages

36-The Random Walk Revealed

Uploaded by

Fetog
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Stocks & Commodities V.

29:12 (10-16): The Random Walk Revealed by Ron Davis

When it was first proposed, the random


walk index was an attempt to generate
cycle-free trend identification. Here’s
a look at what the random walk really
is, how it fits with other indicators, and
an expanded trading diary to show how
it works.

Background
In the early 1990s, E. Michael Poulos
wrote a series of articles for Stocks &
Commodities in which he introduced
the random walk index. The concept was
borrowed from the probability theorist
and teacher William Feller, wherein it
was referred to as a “drunkard’s walk.”
In his honor, I will refer to my material
thus.
Feller posed the question, “If a drunk
leaves the lamp post he is leaning against,
how far would he have gone, on average,
after n steps?” The answer is he would
have gone the square root of n multiplied
by the average length of his stride:

√n * Average length of stride

Using this solution, Poulos constructed


his random walk index by creating an
up walk and a down walk, then compar-
ing them against each other and with a
random walk.
The up walk is constructed by subtract-
ing the lowest price of the last n periods
from the current high. Let’s call that “up
distance.” Count the number of periods
from that low point to now. Call that k.
Finally, compute the average true range
(Atr) for the k periods:
LISA HANEY
(Up distance)
Up walk =
Is The Drunkard Still Walking? k * ATR

The Random Walk Revealed


Repeat the process for the down walk,
substituting the highest price and current
low into the up walk. The denominator is
Most indicators are correlated to the cyclical movements of the market. Here is in the equation to make the up and down
an indicator that can identify trends without considering where in the cycle the walks comparable to a random walk and
market is located. to walks taken from other price series.
Without the denominator, you could not
by Ron Davis compare the readings in the gold market
with those in the currency market, nor the

N
early all technical indicators depend upon the ever-changing cyclic content currency market with the stock market,
of the market to generate information. When the indicator is synchronized and so on.
with the current market cycle, the signals are timely. If the indicator is When either series is above “1,” Poulos
misaligned, however, the signals will be out of phase and thus useless. viewed the market as trending in that di-
Copyright © Technical Analysis Inc.
Stocks & Commodities V. 29:12 (10-16): The Random Walk Revealed by Ron Davis

ZW 09-11 (Daily) 11/22/2010 - 9/2/2011


950.00
900.00
850.00
800.00
750.00
730.00
700.00
650.00
600.00
200
0-59.56
CClr (ZW 09-11 (Daily), 14) -200
1
0.5
0.183
0
PctBforArticle
- (ZW 09-11 (Daily), 14)
DrunkardWalkBB (ZW 09-11 (Daily), 80,20,2,1) 2
1
0.695
0
63.66
50
StochasticsRon(ZW 09-11 (Daily), 14,3,3) 21.89
0
-50

Ninjatrader
WilliamsRrom(ZW 09-11 (Daily), 14) -77.78
-100
Dec 2011 Feb Mar Apr May Jun Jul Aug Sep

Figure 1: overbought/oversold indicators. All overbought (red)/oversold (cyan) indicators find much the same tops/bottoms.

rection. The goal of all this was to create a parameter-free way


to trade. I have worked with a number of permutations of the When it was first
ideas and found none that, standing alone, made a good, robust
system. What I found instead is that the approach can gener-
proposed, the random
ate useful oversold (OS) and overbought (OB) information, walk index was an attempt
especially when put beside a standard OB-OS oscillator. to generate cycle-free
Figure 1 shows that all the OB-OS methods generate the same trend identification.
signals if set to the same time frame. The methods shown are
stochastics, %b, drunkard’s walk (DW), commodity channel
index, and %R. John Bollinger’s %b is not part of the standard Bollinger Band; red is displayed when the up walk penetrated
charting package. The computation is: %b = (Close – Lbb)/ its upper Bollinger Band. The DW contains additional infor-
(Ubb-Lbb) where Lbb is the lower Bollinger Band and Ubb is mation. The TradeStation code for DW is displayed in the
the upper band. The TradeStation code is displayed in the first sidebar, “TradeStation Code For DW.”
sidebar, “TradeStation Code For Pct_B.” The areas marked In Figures 2 through 5, while keeping the red–cyan scheme,
red on an indicator shows overbought areas, while oversold the charts will display yellow when the down walk drops
areas are marked in cyan. below its lower BBand; they will display blue when the up
The DW overbought/oversold signals in Figure 1 were walk has dropped below its lower BBand. The overlay of the
generated by using Bollinger Bands on the up walk and down two walks makes it easy to see which one is larger, and usu-
walk. Cyan areas show that the down walk exceeded its upper ally you can see the difference.

TradeStation Code For Pct_B if BollingerBand(Close, Lookback,SDev)-BollingerBand(Close, Lookback,-SDev)>0 then


denom = BollingerBand(Close, Lookback,SDev)-BollingerBand(Close, Lookback,-SDev)
INPUT: Else denom = 2;
lookback(14),
SDev(2), PctB = (C -BollingerBand(Close, Lookback,-SDev))/denom;
UpperLine(1), If PctB < LowerLine then setplotcolor(1,cyan);
LowerLine(0); If PctB > UpperLine then setplotcolor(1, red);
Plot1(PctB,”%b”);
VARS: Plot2(UpperLine,”U”);
PctB(1), Plot3(LowerLine,”L”);
denom(2); Plot4(.50,”.5”);

Copyright © Technical Analysis Inc.


Stocks & Commodities V. 29:12 (10-16): The Random Walk Revealed by Ron Davis
^DJIA (Daily) 8/4//2010 - 5/11/2011
13000.00
12630.03
12500.00

12000.00

-1 11500.00
+1 +1

+1 11000.00
5
“no buy” 10500.00
+1 bars
10000.00
%b(^DJIA (Daily), 20)
1
0.757
0.5
0
%b(^DJIA (Daily), 80) 1 0.996
-
0.5

0
DWBBL(^DJIA (Daily), 20,20,2,1) 3
2
1.23
0.355
0 63.66
4
DWBBL(^DJIA (Daily), 80,20,2,1)
2
1.1
0.179
Sep Oct Nov Dec 2011 Feb Mar Apr May
Figure 2: %b and dw. Drunkard’s walk gains information content on a longer time frame while %b loses information. For both indicators, the shorter time
frame is above the longer; +1 marks more information for long DW; ‑1 is more information for short DW.

In Figure 2, %b and the DW are shown at a 20-bar lookback the up walk being larger, and below the midline it corresponds
(top pair) and an 80-bar lookback (bottom pair). The longer DW to the down walk being stronger. Similarly, the 20-period up
loses some salient information but gains four items. However, walk corresponds closely to the %b; I find the %b to be more
the %b loses information at that setting and gains none. crisp and easier to scale using zero and 1. However, as you
The DW and %b both contain information about the direc- can see from Figure 2, the DW contains information not found
tion of the trend. The %b above the midline corresponds to in either the 20-period or 80-period %b.

TradeStation Code For DW


(Squareroot(LongDnRun)*Denom);
end;
INPUT:
DaysBack(80),
// If the contrary value decreases rapidly, alert
SD(2);
If LongUpWalk <=BollingerBand(LongUpWalk,20,-SD) then begin
VARS:
setplotcolor(1,blue);
Denom(1),
setplotcolor(4,blue);
LongHigh(0),
end;
LongLow(0),
If LongDnWalk <=BollingerBand(LongDnWalk,20,-SD) then begin
LongMaxBar(0),
setplotcolor(2,yellow);
LongMinBar(0),
setplotcolor(5,yellow);
LongUpRun(0),
end;
LongDnRun(0),
LongUpWalk(0),
// if things are getting out of hand, warn
LongDnWalk(0);
If LongUpWalk >= BollingerBand(LongUpWalk,20,SD)then begin
setplotcolor(1,red);
LongHigh = Highest(High,DaysBack);
setplotcolor(4,red);
LongLow = Lowest(Low,DaysBack);
end;

LongMaxBar = HighestBar(high,DaysBack);
If LongDnWalk >= BollingerBand(LongDnWalk,20,SD)then begin
LongMinBar = LowestBar(Low,DaysBack);
setplotcolor(2,cyan);
setplotcolor(5,cyan);
LongDnRun = CurrentBar-LongMaxBar;
end;
LongUpRun = Currentbar - LongMinBar;
// Plot indicators
If LongDnRun > 0 and LongUpRun > 0 then begin
If AvgTrueRange(LongUpRun) > 0 then Denom =
Plot1(LongUpWalk,”UP”);
AvgTrueRange(LongUpRun) else denom = 1;
Plot2(LongDnWalk,”DN”);
LongUpWalk = (High-LongLow)/
(Squareroot(LongUpRun)*Denom);
If LongDnWalk > LongUpWalk then plot4(-LongUpWalk,”UpM”)
If AvgTrueRange(LongDnRun) > 0 then Denom =
Else
AvgTrueRange(LongDnRun) else denom = 1;
plot5(-LongDnWalk,”DnM”);
LongDnWalk = (LongHigh -Low)/

Copyright © Technical Analysis Inc.


Stocks & Commodities V. 29:12 (10-16): The Random Walk Revealed by Ron Davis
^DJIA (Daily) 11/17/2010 - 9/30/2011
13000.00
12800.00
12600.00
12400.00
12200.00
12000.00
11800.00
11600.00
11400.00
11200.00
11000.00
10913.38
10800.00
10600.00
PctBforArticle(^DJIA
- (Daily), 14)
1

0.497

DWBB(^DJIA (Daily), 80,20,2,1) 4


3 63.66
2
10.655
00.293
Dec 2011 Feb Mar Apr May Jun Jul Aug Sep Oct

FIGURE 3: TRENDLINES ACROSS THE WALK. Note the trendline across the up walk: a sign that air is coming out of the balloon.

Using the drunkard’s walk would have stopped if this bar goes up and moves closer
The examples here all focus on using DW with to the short-term trendline. In this situation, I buy the up
%b. My approach is to view technical studies breakout. Almost immediately (in two hours), the indica-
in relationship with price action. I will keep tors read overbought so I took profits on the close, but you
price action analysis to a bare minimum. could use a different exit approach.
When DW and %b agree on a condition
— oversold or overbought — the situation is Trade 2, March 9, 6:00: The early morning, pre–US session
clear. The action each trader chooses depends on his or her bars traded down to the moving average, only to be followed
own approach. It is worth noting that many strong moves by a weak rally. The general slope to DW is bearish and
begin with either OB or OS readings. %b is showing weakness. This is an uncomfortable trade
Trendlines drawn across the walk are useful (Figure 3). because the third bar has a wide range followed by a rally.
Fading rising trendlines are not very profitable. A better ap- The best result is to exit on the open of March 11. By that
proach would be to use corrections as opportunities to get point, the drunkard’s walk has shown both a yellow, “up
in or to add to your position. Adding to your position when walk falling too fast” impression and a cyan oversold read-
the DW trendline is down is riskier. You are usually safe if ing, and the %b has generated a higher oversold reading,
both indicators read OB or OS. When the indicators diverge, hence divergent from the major thrust of the day before.
look at the slope of the DW for guidance regarding probable The brown down walk is also much weaker. All this alarms
future direction. me, so I exit on the first higher high at the “X.”

A trader’s diary Trade 3, March 14, 8:00: In the non–pit session trading,
In Figure 4 you see an annotated version of my trading chart the DW was pushed into several bars of overbought and %b
for trades 1 to 5. The chart is the hourly emini contract for June was nearly overbought. The presession morning trading was
2011, using 24-hour data. Since I don’t trade around the clock, down, with a rally into the US opening. The first lower low
most of the trades shown are only for US pit hours, using Pacific of the US session was at 8 am, and that was where I shorted.
time. I use the 20-period exponential moving average (Ema), Again, I was out after the 10:00 oversold reading, but the
shown on the chart, as a comfort reference rather than as a trad- better trade was to hold the position until the next morning.
ing tool. I have included some prospective trades from non–US The European session drove prices into a deeply oversold
trading hours to illustrate ideas I think are important. I’m not an area, and the price action was a small double bottom. More
aggressive trader, and I’m sure you’ll see lots of opportunity. aggressive traders might have gone long with the upward
Here are the explanations of each of the trades: breakout that came shortly after the opening.

Trade 1, March 8, 7:00: The prior bar was blue on drunk- Trade 4, March 16, 7:00: Both indicators pushed into the
ard’s walk — an oversold reading. The %b may be a higher overbought range during the prior 24 hours, and prices
low than its two prior lows. The downward motion of price are again near the down trendline. A big plus for me was
Copyright © Technical Analysis Inc.
Stocks & Commodities V. 29:12 (10-16): The Random Walk Revealed by Ron Davis

ES 06-11 (60 min) 3/21/2010


#2
X 1325.00
1320.00
1315.00
1310.00
#3 1305.00
1300.00
#1
1295.00
1289.75
#4
X 1285.00
1281.69
1280.00
X X 1275.00
1270.00
1265.00
1260.00
#5 1255.00
Small double
1250.00
bottom 1245.00
X 1240.00
-
1 0.952

0.5
0
%b(ES 06-11 (60 min), 20)
DWBBL(ES 06-11 (60 min), 100,20,2,1)
1
0.874
0.5
0.0867
0
3/8 3/9 3/10 3/11 3/13 3/15 3/16 3/17 3/18 3/20

FIGURE 4: TRADING DIARY. On this 60-minute chart of the S&P emini contract you see trades 1 to 5 annotated. The 20-period EMA is overlaid on the price
chart. Here you see examples of the entries and exits based on various criteria such as breakouts, oversold/overbought indicators, DW, %b, and upwalks,
among others.

the wedge or triangle. Prior to the New York open, prices the first time since March 9. Thus, buy the breakout, exit
returned to the lower line of the triangle, and then the day’s on the oversold reading.
first bar brought a breakout down. I
included a standard wedge measur-
ing for this trade. The dotted red line
is 100%; the blue line below is 161%.
Those lines correspond to winning
16 and 26 points, respectively.
An aggressive trader might con-
sider taking a long position between
trades 4 and 5. That possible trade
would have started in the Asian/
Australian session and been ripe for
exiting midmorning in the following
US session. The basis of the trade
was the downsloping drunkard’s
walk, which indicates a weakening
of trend, nearby oversold readings
in both indicators, and divergence
from price in both.

Trade 5, March 17: This trade is


imaginary, with both entry and exit
occurring during the Asian/Austra-
lian session. It is included only for
illustrative purposes. The reasoning
is that DW down walk has been
decreasing for the past two days or
more, as noted by the trendline across
the tops; and divergence between
price and %b (%b is lower while price
made a small double bottom) and the
two DW walks are about equal for
Copyright © Technical Analysis Inc.
Stocks & Commodities V. 29:12 (10-16): The Random Walk Revealed by Ron Davis
ES 06-11 (60 min) 3/30/2011
1325.00
1322.25
#9 1320.00
X 1348.38
1315.00
1310.00
1305.00
#6 1300.00
X
#10 1295.00
1290.00
X 1285.00
#8
X 1280.00
X 1275.00
#7
1270.00
1265.00
1260.00
#5 1255.00
Small double 1250.00
bottom 1245.00
1240.00
-
1 0.876

0.5
0
%b(ES 06-11 (60 min), 20)
DWBBL(ES 06-11 (60 min), 100,20,2,1) 2
Downward DW trendline for down 1.5
1
0.5
0.0689
3/17 3/18 3/20 3/22 3/23 3/24 3/25 3/27 3/29 3/20

FIGURE 5: IS DW A USEFUL TRADING TOOL? This is a continuation of the chart seen in Figure 4, displaying trades 6 to 10.

Trades 6 to 10 are displayed in Figure 5. Trade 10, March 29, 8:00: Oversold on the DW (at my
previous exit) with a rising tide in %b and a double bottom
Trade 6, March 22, 7:00: Price and DW made a double in price made an easy-to-find setup. I bought the breakout
top. The %b had a higher high, with the second high push- upward and then exited at my original target of 1325.
ing into the overbought zone. This combination is set up
with above-average safety. I shorted the breakout down; Perhaps the random walk index was not effective as a system
1282 was my target price, but the deeply oversold %b and because despite the intentions of the originator, it is not a cycle-
oversold DW around 1284 persuaded me to exit. free indicator. That is clear from comparing John Bollinger’s %b
with the same-period random walk index. With respect to trend
Trade 7, March 23, 9:00: At this point, I was thinking in identification, the two are virtually identical, but the drunkard’s
terms of another leg in a longer bull run. My estimated price walk makes information contained in the random walk index
target was 1325. The DW generated an oversold reading clear but previously untapped. We have also seen that the newly
not shared by the %b, often a bullish condition. I did not used information captured in the drunkard’s walk is closer to
exit on the overbought condition at the end of the session. being cycle-free, as demonstrated in the comparison between
The next trade was to add to my position. the 20- and 80-period DW charts and the %b charts.
The trading diary I have walked you through will allow
Trade 8, March 24, 8:00: The 7:00 bar was a scary de- you to decide whether the drunkard’s walk could be useful
cline out of an overbought %b reading and a considerably for your own trading.
weakened DW. The up swing generated a higher high, so
I left my capital protection stop in place and put in a buy Ron Davis trades for his own account. He is a member of
for above the 7:00 bar. If the stop is hit, it could generate the peer review committee for the Journal of the Market
a nice bull trap and some upward momentum, and that Technicians Association. He may be reached at j.ron.davis@
turned out to be the case. At 9:00 on March 25, another gmail.com.
overbought at a prospective double top was too much for
me and I closed my position. Suggested reading
Feller, William [1957]. Introduction To Probability Theory
Trade 9, March 28, 12:00: Prices had not been able to And Its Applications, 2d ed., John Wiley & Sons.
move much in either the Asian or European sessions. The Poulos, E. Michael [1991]. “Of Trends And Random Walks,”
DW generated an odd overbought reading and the %b was Technical Analysis of Stocks & Commodities, Volume
implying price weakness. There was also a small triangle, 9: February.
which is a formation I like to trade. I shorted the breakout _____ [1992]. “Are There Persistent Cycles?” Technical Analy-
and exited at the end of the day. This sudden, short selloff sis of Stocks & Commodities, Volume 10: September.
was enough to generate oversold readings on both indica- ‡NinjaTrader
tors — an exit for me.
Copyright © Technical Analysis Inc.

You might also like