Back to builder reference

Value ref

rolling_stats

A rolling statistic of source over lookback_bars — mean, std, zscore, sum, count, rank, percentile or ema.

source accepts ANY value ref, including a nested binary_expr, so this is the general smoothing and normalisation primitive: an SMA of an arbitrary expression is stat="mean", and a rolling z-score of a spread is stat="zscore". Combined with rolling_max/rolling_min it expresses whole indicator families that have no dedicated type — the %K of a stochastic over any series is a 3-bar "mean" of the normalised ratio.

NaN propagates: one missing value in the window returns NaN, and a NaN operand makes the enclosing compare false. Purpose-built indicators that compact their buffers to finite samples (srsi_k, stochastic_k) survive undefined stretches that this ref does not, so they are not redundant with it.

percentile_level is required when stat="percentile" and must be omitted otherwise.

Backing types

RollingStatsValueRef

Required fields

None.

Optional fields

None.

Backing types

The IR ValueRef classes this builder field resolves to.

RollingStatsValueRef
Quawd

A subscription SaaS platform for designing, backtesting, and paper-trading algorithmic trading strategies on equities and crypto — described in plain English to an AI agent, no code required.

© 2026 Quawd. All rights reserved.

Quawd is a software tool, not a broker-dealer or investment adviser, and does not provide investment advice. Trading involves substantial risk of loss. Backtested and hypothetical results have inherent limitations and are not indicative of future performance.