def MAXINDEX(df, n, price='Close'):
    """
    Index of highest value over a specified period
    Returns: list of ints = jhta.MAXINDEX(df, n, price='Close')
    """
    max_index_list = []
    if n == len(df[price]):
        start = None
        for i in range(len(df[price])):
            if df[price][i] != df[price][i]:
                max_index = float('NaN')
            else:
                if start is None:
                    start = i
                end = i + 1
                max_index = df[price][start:end].index(max(df[price][start:
                    end]))
            max_index_list.append(max_index)
    else:
        for i in range(len(df[price])):
            if i + 1 < n:
                max_index = float('NaN')
            else:
                start = i + 1 - n
                end = i + 1
                max_index = df[price][start:end].index(max(df[price][start:
                    end]))
            max_index_list.append(max_index)
    return max_index_list
