def AD(df, high='High', low='Low', close='Close', volume='Volume'):
    """
    Chaikin A/D Line
    Returns: list of floats = jhta.AD(df, high='High', low='Low', close='Close', volume='Volume')
    Source: https://www.fmlabs.com/reference/default.htm?url=AccumDist.htm
    """
    ad_list = []
    for i in range(len(df[close])):
        ad = 0
        if i > 0:
            clv = (df[close][i] - df[low][i] - (df[high][i] - df[close][i])
                ) / (df[high][i] - df[low][i])
            ad = ad_list[i - 1] + clv * df[volume][i]
        ad_list.append(ad)
    return ad_list
