Williams’%R is an overbought / oversold indicator. Values -80 and -20 can be used as limits to detect overbought and oversold situations.
Nevertheless, it is better to wait for a change in the price direction, which can be detected for instance through MACD indicator analysis, before buying or selling.
Note that when %R makes a peak and reverses, a price decline often takes place.
This indicator is already available in the platform as a built-in instruction: http://www.prorealcode.com/documentation/williams/ , but the code isn’t available and it was requested in french forum, so here it is.
//PRC_WilliamsRpercent
//01.09.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
period = 14
hh = highest[period](high)
ll = lowest[period](low)
Wp = ((hh-close)/(hh-ll))*-100
return Wp as "Williams R percent", -20 as "-20 level", -80 as "-80 level"