This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.



wpctr = willpctr(highp,lowp,closep,nperiods)
wpctr = willpctr([highp, lowp, closep],nperiods)
wpctrts = willpctr(tsobj)
wpctrts = willpctr(tsobj,nperiods)
wpctrts = willpctr(tsobj,nperiods,'ParameterName',ParameterValue,... )



High price (vector)


Low price (vector)


Closing price (vector)


Number of periods (scalar). Default = 14.


Financial time series object


wpctr = willpctr(highp,lowp,closep,nperiods) calculates the Williams %R values for the given set of stock prices for a specified number of periods nperiods. The stock prices needed are the high (highp), low (lowp), and closing (closep) prices. wpctr is a vector that represents the Williams %R values from the stock data.

wpctr = willpctr([highp, lowp, closep],nperiods) accepts the price input as a three-column matrix representing the high, low, and closing prices, in that order.

wpctrts = willpctr(tsobj) calculates the Williams %R values for the financial time series object tsobj. The object must contain at least three data series named High (high prices), Low (low prices), and Close (closing prices). wpctrts is a financial time series object with the same dates as tsobj and a single data series named WillPctR.

wpctrts = willpctr(tsobj,nperiods) calculates the Williams %R values for the financial time series object tsobj for nperiods periods.

wpctrts = willpctr(tsobj,nperiods,'ParameterName',ParameterValue, ...) accepts parameter name/parameter value pairs as input. These pairs specify the name(s) for the required data series if it is different from the expected default name(s). Valid parameter names are

  • HighName: high prices series name

  • LowName: low prices series name

  • CloseName: closing prices series name

Parameter values are the character vectors that represent the valid parameter names.


collapse all

This example shows how to compute the Williams %R values for Disney stock and plot the results.

load disney.mat
dis_Wpctr = willpctr(dis);
title('Williams %R for Disney')


Achelis, Steven B. Technical Analysis from A to Z. Second Edition. McGraw-Hill, 1995, pp. 316–317.

Introduced before R2006a

Was this topic helpful?