Williams %R

View as Markdown

Description

Developed by Larry Williams, Williams %R is a momentum indicator that works much like the Stochastic Oscillator. It is especially popular for measuring overbought and oversold levels. The scale ranges from 0 to -100 with readings from 0 to -20 considered overbought, and readings from -80 to -100 considered oversold.

… Courtesy of StockCharts

Syntax

WilliamsR(int period)

WilliamsR(ISeries\<double\> input, int period)

Returns default value

WilliamsR(int period)[int barsAgo]

WilliamsR(ISeries\<double\> input, int period)[int barsAgo]

Return Value

double; Accessing this method via an index value [int barsAgo] returns the indicator value of the referenced bar.

Parameters

ParameterDescription
inputIndicator source data (Series<T>)
periodNumber of bars used in the calculation

Examples

1// Prints the current value of a 20 period WilliamsR using default price type
2double value = WilliamsR(20)[0];
3Print("The current WilliamsR value is " + value.ToString());
4
5// Prints the current value of a 20 period WilliamsR using high price type
6double value = WilliamsR(High, 20)[0];
7Print("The current WilliamsR value is " + value.ToString());

Source Code

You can view this indicator method source code by selecting the menu New > NinjaScript Editor > Indicators within the NinjaTrader Control Center window.