Rolling Sharpe Pass Node

Rolling Sharpe Ratio — Series Input

StatisticalRisk-Adjusted ReturnPass

Overview

The Rolling Sharpe Pass Node computes the rolling Sharpe ratio — the excess return per unit of total volatility — over a sliding window. It is the most widely used risk-adjusted return metric in quantitative finance.

A positive rolling Sharpe means the strategy generates more return than the risk-free rate per unit of risk taken. Negative Sharpe indicates underperformance relative to the risk-free rate after accounting for volatility.

Formula

Rolling Sharpe:
Sharpe[t] = (mean(returns in window) − riskFreeRate) / std(returns in window)
riskFreeRate is per-bar (e.g. 0 for zero risk-free, or 0.00004 ≈ 1% annual daily).
Returns null when std = 0 (constant returns in window).

Parameters

ParameterDefaultDescription
period20Rolling window in bars
riskFreeRate0Per-bar risk-free rate subtracted from returns before ratio

Inputs & Outputs

SlotDirectionTypeDescription
inputInput{ values, timestamps }Returns series (per-bar)
valuesOutput(number | null)[]Rolling Sharpe ratio per bar; nulls during warm-up
timestampsOutputnumber[]Unix timestamps aligned to input

Use Cases

Performance Monitoring

Track rolling Sharpe in real time to detect when a strategy degrades from its historical performance profile.

Strategy On/Off Switch

Disable position entry when rolling Sharpe drops below zero — a simple and effective regime filter for any returns-based strategy.

Strategy Comparison

Compare multiple strategies' rolling Sharpe on the same chart to dynamically allocate capital to the highest-quality performer.

Tips & Best Practices

Annualise for Comparison

To annualise: multiply by √252 (daily), √52 (weekly), or √12 (monthly). This converts the per-period Sharpe to a standard annualised form.

Assumes Normal Returns

Sharpe ignores skewness and kurtosis. For non-normal returns, also evaluate Omega Ratio or CVaR-adjusted metrics.

Use 60+ Bar Windows

Short windows (period < 20) produce very noisy Sharpe estimates. Use period = 60 or 252 bars for meaningful rolling Sharpe.

Related Indicators