You compute a feature with df.rolling(21, center=True).mean(). · QuantMax