def IMI(df, open='Open', close='Close'):
    """
    Intraday Momentum Index
    Returns: list of floats = jhta.IMI(df, open='Open', close='Close')
    Source: https://www.fmlabs.com/reference/default.htm?url=IMI.htm
    """
    imi_list = []
    upsum = 0.0
    downsum = 0.0
    for i in range(len(df[close])):
        if df[close][i] > df[open][i]:
            upsum = upsum + (df[close][i] - df[open][i])
        else:
            downsum = downsum + (df[open][i] - df[close][i])
        imi = 100 * (upsum / (upsum + downsum))
        imi_list.append(imi)
    return imi_list
