| Financial Toolbox™ | ![]() |
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, ... )
highp | High price (vector) |
lowp | Low price (vector) |
closep | Closing price (vector) |
nperiods | Number of periods (scalar). Default = 14. |
tsobj | 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 strings that represent the valid parameter names.
Compute the Williams %R values for Disney stock and plot the results:
load disney.mat
dis_Wpctr = willpctr(dis)
plot(dis_Wpctr)
title('Williams %R for Disney')

Achelis, Steven B., Technical Analysis from A to Z, Second printing, McGraw-Hill, 1995, pp. 316 - 317.
![]() | willad | wrkdydif | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |