def WILLR(data, period=14):
    """
    Williams %R

    Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to
    the high and low of the past N days (for a given N).

    It was developed by a publisher and promoter of trading materials, Larry Williams.

    It's purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in
    between, of its recent trading range.

    The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).

    :param pd.DataFrame data: pandas DataFrame with open, high, low, close data
    :param int period: period used for indicator calculation period used for indicator calculation
    :return pd.Series: with indicator data calculation results
    """
    willr_list = []
    i = 0
    close, high, low = data['close'], data['high'], data['low']
    while i < len(close):
        if i + 1 < period:
            willr = float(' NaN')
        else:
            start = i + 1 - period
            end = i + 1
            willr = (max(high[start:end]) - close[i]) / (max(high[start:end]) - min(low[start:end])) * 100
        #            willr *= -1
        willr_list.append(willr)
        i += 1
    return willr_list