Portfolio Performance Measurement › Rolling Performance Analysis
Michael BrenndoerferDecember 16, 20254 min read
Quantitative FinanceAll chapters Part 9 of 15Portfolio Theory and Investment Analysis
Portfolio Performance Measurement › Rolling Performance AnalysisOne section · Sections in this chapter7 / 11 ↓
Sections in this chapter11
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Static performance metrics over the full period can mask time-varying behavior. A manager might have excellent performance in one regime but poor performance in another. Rolling analysis captures this dynamic by computing metrics over moving windows.
In[29]:
Codedef rolling_sharpe(returns, risk_free_rate, window, periods_per_year=252):
"""Calculate rolling Sharpe ratio."""
rolling_mean = pd.Series(returns).rolling(window).mean()
rolling_std = pd.Series(returns).rolling(window).std()
rolling_sr = (
(rolling_mean - risk_free_rate)
/ rolling_std
* np.sqrt(periods_per_year)
)
return rolling_sr.values
def rolling_max_drawdown(returns, window):
"""Calculate rolling maximum drawdown."""
cumulative = (1 + pd.Series(returns)).cumprod()
rolling_max = cumulative.rolling(window, min_periods=1).max()
drawdown = (rolling_max - cumulative) / rolling_max
rolling_max_dd = drawdown.rolling(window).max()
return rolling_max_dd.valuesIn[30]:
Code# Calculate rolling metrics with 252-day (1 year) window
window = 252
df["rolling_sharpe_portfolio"] = rolling_sharpe(
df["portfolio"].values, daily_rf, window
)
df["rolling_sharpe_benchmark"] = rolling_sharpe(
df["benchmark"].values, daily_rf, window
)
df["rolling_maxdd_portfolio"] = rolling_max_drawdown(
df["portfolio"].values, window
)
df["rolling_maxdd_benchmark"] = rolling_max_drawdown(
df["benchmark"].values, window
)Out[31]:
Visualization

Rolling analysis reveals that performance metrics are not constants; they fluctuate with market conditions. A manager with an impressive full-period Sharpe ratio might have experienced extended periods of negative Sharpe, which rolling analysis would reveal.
Out[32]:
Visualization