Log in to see Cloud of Tags

Wealth-Lab Wiki

Syntax

public static WilliamsR Series(Bars bars, int period)
public WilliamsR(Bars bars, int period, string description)

Parameter Description

bars The Bars object
period Indicator calculation period

Description

Williams %R is a momentum indicator developed by Larry Williams. Like Stochastic Oscillators (StochK, StochD), WilliamsR is used to gauge overbought and oversold levels, and ranges between 0 and 100. However, unlike most other momentum oscillators, the low end of the scale represents an overbought area, and the high end an oversold condition. For this reason Williams %R is often multiplied by -1 and plotted on a negative scale.

Williams %R measures the latest closing price relative to high low range within the past data, thus it reflects buyers and sellers commitment to close the price within that range. At the peak of the buyer's power the oscillator reaches zero, and at the peak of the seller's power, it reaches 100. The overbought region is below 10 percent and the oversold region is over 90 percent.

Interpretation

A reading of above 80 or 90 indicates oversold levels, and below 20 or 10 indicates overbought. Williams %R has a tendency to peak ahead of price, so it can be a good tool in identifying trend reversals. During strong trends, the Williams %R can remain in the oversold or overbought regions for extended periods of time.

  • In ranging markets, go long when the indicator falls below the oversold line then rises back above the oversold line.
  • In ranging markets, go short when indicator rises above the overbought line the falls back below the overbought line.
  • In ranging markets, go long on bullish divergences, if the indicator's first trough is in the oversold zone.
  • In ranging markets, go short on bearish divergences, if the indicator's first peak is in the overbought zone.
  • In a up trend or rally, go short if the indicator fails to reach the oversold region and begins to fall. This is a swing failure, it show the buyers are weakening.
  • In a down trend, go long when the indicator fails to reach the overbought region and begins to rise. This is a swing failure, it show the sellers are weakening.

Calculation

Wm%R = 100 * ( Hn - C ) / ( Hn - Ln )

where,

n = period, such as 7 days
Hn = Highest high in last n periods
Ln = Lowest low in last n period
C = closing price of latest bar


Note that Williams %R readings may contradict standards - the common wisdom is to use an inversed scale from 0 to -100. As a workaround, multiply the final result by -1:
DataSeries PctR = WilliamsR.Series( Bars, 14 );
PctR *= -1;



Example

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Color the chart background for smoothed Williams %R oversold and overbought levels

DataSeries PctR = WilliamsR.Series( Bars, 14 ); DataSeries SmoothR = WilderMA.Series( PctR, 4 ); ChartPane PctRPane = CreatePane( 35, true, true ); PlotSeries( PctRPane, PctR, Color.SaddleBrown, WealthLab.LineStyle.Solid, 1 ); PlotSeries( PctRPane, SmoothR, Color.Black, WealthLab.LineStyle.Solid, 1 ); Color RedBkg = Color.FromArgb(255, 227, 231); Color BlueBkg = Color.FromArgb(50,0,100,255);

for(int bar = 20; bar < Bars.Count; bar++) { if( SmoothR[bar] < 20 ) SetBackgroundColor( bar, RedBkg ); else if( SmoothR[bar] > 80 ) SetBackgroundColor( bar, BlueBkg ); } } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.