ilocs_window = pd.rolling_apply(df, window=5, func=lambda x: x.argmax(),
    min_periods=1)
ilocs = ilocs_window['value'] + ([0, 0, 0, 0] + list(range(len(ilocs_window) - 4)))
df['rolling_max_date'] = df.index.take(ilocs)
Most recent max/min value