def PVI(df, price='Close', volume='Volume'):
    """
    Positive Volume Index
    Returns: list of floats = jhta.PVI(df, price='Close', volume='Volume')
    Source: https://www.fmlabs.com/reference/default.htm?url=PVI.htm
    """
    pvi_list = []
    for i in range(len(df[price])):
        pvi = 0
        if i > 0:
            if df[volume][i] > df[volume][i - 1]:
                pvi = pvi_list[i - 1] + (df[price][i] - df[price][i - 1]) / df[
                    price][i - 1]
            else:
                pvi = pvi_list[i - 1]
        pvi_list.append(pvi)
    return pvi_list
