def relative_strength_index(prices, interval=10):
    """
    Computes Relative Strength Index given a price series and lookback interval
    See more here https://www.investopedia.com/terms/r/rsi.asp
    """
    delta = prices.diff()

    # copy deltas, set losses to 0, get rolling avg
    gains = delta.copy()
    gains[gains < 0] = 0
    avg_gain = gains.rolling(interval).mean()

    # copy deltas, set gains to 0, get rolling avg
    losses = delta.copy()
    losses[losses > 0] = 0
    avg_loss = losses.rolling(interval).mean().abs()

    # calculate relative strength and it's index
    rs = avg_gain / avg_loss
    rsi = 100.0 - (100.0 / (1.0 + rs))
    return rsi