Last Updated on June 11, 2021 by Oddmund Groette
The famous trader and tax rebellion Larry Williams has given names to several technical indicators. Last week we wrote about WilliamsVixFix:
This article explains how to calculate the Williams %R, how you can use it, and we backtest strategies to see if the Williams %R works.
What is the Williams %R indicator?
The Willaims %R fluctuates between 0 to -100. It’s an oscillating indicator and reflects the current close relative to the highest high for the lookback period. The indicator is somewhat similar to the stochastic indicator, however, that one measures the close relative to the lowest low. A high reading is considered overbought, and low readings are considered oversold.
Here is how a 5-day lookback period looks in the S&P 500:
Williams %R goes quickly from overbought and oversold conditions. Thus, it is mainly used as a mean reversion indicator.
How do you calculate Williams %r indicator?
If you use a lookback period of five days the formula looks like this:
Williams %R = ( ( highest high last 5 days – close ) / ( highest high last 5 days – lowest low last 5 days) )* -100
For example: if the close today is 100, the highest high over the last five days was 115, and the lowest low over the last five days was 95, then the Williams %R is -75 ( (15/20) *-100 )
Williams %R resembles WilliamsVixFix
The Williams %R is pretty similar to the WilliamsVixFix (but inversely from each other). The chart below is both indicators using a 22-day lookback period:
Williams %R – does it work? We test some strategies
We test the Williams %R on the S&P 500. Entry is on the close when the Williams %R is below -90 and exit is when today’s close is higher than yesterday’s high or when the Williams %R closes above -30.
By using optimization we get, perhaps as expected, the best results on short lookback periods. We used a minimum lookback period of two days and a maximum of 25 days. All tests gave a profit factor of two or more, except for 25 days which produced 1.9.
The best result is by using a two-day lookback period. This gives this equity curve:
Both during the GFC in 2008/09 and the Covid-19, the strategy performed exceptionally well. The percentage return in 2008 and 2020 were 98.9% and 43.3%! The returns above are compounded. CAGR is 12.4% (buy and hold is 6.5%), exposure is 23%, the number of trades is 397, average gain per trade is 0.64%, max drawdown is 17%, and the profit factor is 2.36. These are pretty good numbers!
Does the Williams %R work for shorts?
Unfortunately, and as expected, it’s much more difficult to find profitable strategies on the short side.
Williams %R Amibroker code:
Using a 5-day lookback period the Amibroker code looks like this (including a plot of the indicator):
Williams %R = ( ( HHV(H,5) – Close ) / ( HHV(H,5) – LLV(L,5) ) ) * -100 ;
Plot(Williams %R,”Williams %R”,colorRed,styleLine);
Williams %R vs. RSI and stochastic
The Williams %R is a mean revertive indicator, just like the Relative Strength Indicator (RSI) and Stochastics. Let’s test the RSI by using “similar” criteria as we did above for the Williams %R:
- Enter on the close when the two-day RSI is below 10
- Exit on the close when the close is higher than yesterday’s high or when the RSI(2) ends higher than 70
These criteria yield this equity curve:
Williams %R works perfectly with this indicator:
We changed the settings somewhat to test another strategy that included a second indicator and we got this equity curve on Nasdaq/QQQ (logarithmic):
The CAGR is 14.6% (buy and hold is 6.4%), the time spent in the market is 14.2%, 215 trades, 79% winners, the average winner is 2.35%, the average loser is 2.21%, the profit factor is 3.53, max drawdown is 20.5%, and the Sharpe Ratio is 3.16.
Would you like to know the code and the criteria (in Amibroker/Tradestation and plain English)? You can either order the strategy for 75 USD by clicking the link below, or you can subscribe to our Trading Edges. You can order the strategy on this link (please choose Williams %R Strategy No. 3):
When you have paid, please press the link below to access the code (PDF file):
Alternatively, you can subscribe to our Trading Edges where we send out ideas like this monthly for a lower fee per edge. The edge above will be presented as an edge in a few months. If you’d like to receive similar ideas, please subscribe to our Trading Edges:
The Williams %R is pretty similar to the WilliamsVixFix. However, it seems like the Williams %R performs slightly better in our backtests. Moreover, on a wide range of backtests, Williams %R seems to perform better than both the RSI and Stochastics (stochastics not included in this article) in the strategies we tested.
Disclosure: We are not financial advisors. Please do your own due diligence and investment research or consult a financial professional. All articles are our opinion – they are not suggestions to buy or sell any securities.