Overview
ClyptQ provides 17 rolling and 16 accumulated performance metrics. All metrics have Role:METRIC and read from STATE: inputs.
Rolling Metrics
Computed over a sliding window of recent data.Accumulated Metrics
Computed over the entire strategy history (since inception).Detailed Reference
AccumCAGR
Accumulative Compound Annual Growth Rate computed incrementally in O(1) per tick. Stores the first observed equity value and period count, then computes: CAGR = (V_current / V_first) ^ (periods_per_year / n_periods) - 1. Only requires the current tick (lookback=1) since state is maintained internally. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/returns.py
AccumCalmar
Accumulative Calmar Ratio computed incrementally in O(1) per tick. Combines incremental CAGR and maximum drawdown tracking to compute: Calmar = CAGR / |MaxDrawdown|, where CAGR = (V_current / V_first) ^ (1/years) - 1 and MaxDrawdown is the worst peak-to-trough decline since inception. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/calmar.py
AccumCurrentDrawdown
Accumulative current drawdown from peak computed incrementally in O(1) per tick. Tracks the running peak and computes the percentage decline from peak to the current value: current_dd = (V_current - V_peak) / V_peak. Returns 0 when the current value equals or exceeds the all-time peak. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/drawdown.py
AccumDownsideVolatility
Accumulative annualized downside volatility computed incrementally in O(1) per tick. Tracks only negative returns to compute downside deviation since inception: downside_vol = sqrt(mean(negative_returns^2)) * sqrt(periods_per_year). Ignores positive returns entirely, measuring only harmful volatility. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/volatility.py
AccumDrawdownDuration
Accumulative drawdown duration computed incrementally in O(1) per tick. Counts the number of consecutive periods elapsed since the equity reached its all-time peak. Resets to 0 when the current value equals or exceeds the peak; increments by 1 each period the equity remains below peak. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/drawdown.py
AccumMaxDrawdown
Accumulative maximum drawdown computed incrementally in O(1) per tick. Tracks the running peak and computes the worst peak-to-trough decline since inception: MDD = min((V_t - V_peak) / V_peak) for all t seen so far. Result is a negative value (e.g., -0.20 means a 20% maximum drawdown). Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/drawdown.py
AccumNumTrades
Accumulative number of trades computed incrementally in O(1) per tick. Counts the number of periods with non-zero returns (|return| > 1e-10) since inception, using each non-zero return as a proxy for a trade. Useful for tracking trading frequency over time. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/trade_stats.py
AccumProfitFactor
Accumulative profit factor computed incrementally in O(1) per tick. Tracks the running sum of positive and negative returns since inception: profit_factor = sum(positive_returns) / |sum(negative_returns)|. Values above 1.0 indicate more cumulative profit than loss. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/trade_stats.py
AccumSharpe
Accumulative Sharpe Ratio computed incrementally in O(1) per tick. Uses Welford’s online algorithm for numerically stable incremental mean and variance of excess returns. The annualized Sharpe is computed as: Sharpe = (mean_excess * periods_per_year) / (std_excess * sqrt(periods_per_year)), where excess_return = return - rf / periods_per_year. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/sharpe.py
AccumSortino
Accumulative Sortino Ratio computed incrementally in O(1) per tick. Uses Welford’s algorithm for the running mean of excess returns, and tracks downside deviation from only negative returns. The annualized Sortino is: Sortino = (mean_excess * periods_per_year) / (downside_std * sqrt(periods_per_year)), where downside_std = sqrt(mean(negative_returns^2)). Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/sortino.py
AccumTotalReturn
Accumulative total return computed incrementally in O(1) per tick. Stores the first observed equity value and computes total return as total_return = (V_current - V_first) / V_first. Only requires the current tick (lookback=1) since the first value is stored internally. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/returns.py
AccumTotalTurnover
Accumulative total turnover (cumulative sum) computed incrementally in O(1) per tick. Tracks the running sum of all turnover values since inception: total_turnover = sum(turnover_t) for all t. Useful for measuring the total amount of portfolio rebalancing over the entire backtest. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/turnover.py
AccumTurnover
Accumulative average turnover per rebalance computed incrementally in O(1) per tick. Tracks the running sum of non-zero turnover values and their count since inception: avg_turnover = sum(turnover_i) / count(turnover_i above 0). Only counts periods where actual rebalancing occurred (turnover above 0). Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/turnover.py
AccumVolatility
Accumulative annualized volatility computed incrementally in O(1) per tick. Uses Welford’s online algorithm for numerically stable running variance of period returns: vol = sqrt(variance) * sqrt(periods_per_year), where variance is computed incrementally from all returns observed since inception. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/volatility.py
AccumWinRate
Accumulative win rate computed incrementally in O(1) per tick. Tracks the count of positive returns relative to total returns since inception: win_rate = n_positive / n_total. Values range from 0.0 (all losing periods) to 1.0 (all winning periods). Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/trade_stats.py
RollingCAGR
Rolling Compound Annual Growth Rate over a lookback window. Computes CAGR by annualizing the total return over the rolling window: CAGR = (V_end / V_start) ^ (periods_per_year / n_periods) - 1. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/returns.py
RollingCVaR
Rolling Conditional Value at Risk (Expected Shortfall) over a lookback window. Computes CVaR (also known as Expected Shortfall) as the mean of returns that fall below the VaR threshold: CVaR_alpha = mean(returns | returns <= VaR_alpha). This captures the average loss in the worst-case tail scenarios. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/risk.py
RollingCalmar
Rolling Calmar Ratio over a lookback window. Computes the ratio of annualized return to maximum drawdown within the rolling window: Calmar = CAGR / |MaxDrawdown|. A higher Calmar ratio indicates better risk-adjusted performance relative to worst-case loss. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/calmar.py
RollingCurrentDrawdown
Rolling current drawdown from peak to the latest value. Computes the percentage decline from the highest value (peak) within the rolling window to the current (latest) value: current_dd = (V_current - V_peak) / V_peak. Returns 0 when at peak. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/drawdown.py
RollingDownsideVolatility
Rolling annualized downside volatility over a lookback window. Computes the annualized standard deviation using only negative returns: downside_vol = std(negative_returns) * sqrt(periods_per_year). This measures harmful volatility exclusively, ignoring upside deviations. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/volatility.py
RollingDrawdownDuration
Rolling drawdown duration as number of periods since the peak. Counts the number of consecutive periods elapsed since the equity reached its highest value within the rolling window. Returns 0 when the current value equals or exceeds the peak. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/drawdown.py
RollingIC
Rolling Information Coefficient between lagged signal and forward returns. Computes the mean cross-sectional rank correlation (Spearman or Pearson) between a lagged alpha signal and subsequent asset returns over a rolling window: IC = mean(corr(signal_{t-lag}, returns_t)) for t in window. Requires two inputs: the signal and price data. Also provides an Information Ratio via get_ir(). Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/ic.py
RollingMaxDrawdown
Rolling maximum drawdown over a lookback window. Computes the largest peak-to-trough decline within the rolling window: MDD = min((V_t - V_peak) / V_peak) for all t in the window. Result is a negative value (e.g., -0.15 means a 15% drawdown). Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/drawdown.py
RollingProfitFactor
Rolling profit factor over a lookback window. Computes the ratio of gross profits to gross losses within the rolling window: profit_factor = sum(positive_returns) / |sum(negative_returns)|. Values above 1.0 indicate more profit than loss; infinity if no losses. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/trade_stats.py
RollingSharpe
Rolling Sharpe Ratio over a lookback window. Computes the annualized Sharpe ratio from period returns within the rolling window: Sharpe = mean(excess_returns) / std(excess_returns) * sqrt(periods_per_year), where excess_returns = returns - rf / periods_per_year. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/sharpe.py
RollingSortino
Rolling Sortino Ratio over a lookback window. Computes the annualized Sortino ratio using downside deviation instead of total standard deviation: Sortino = mean(excess_returns) / downside_std * sqrt(periods_per_year), where downside_std is computed only from negative returns. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/sortino.py
RollingTotalReturn
Rolling total return over a lookback window. Computes the total return as the percentage change from the first to the last value in the rolling window: total_return = (V_end - V_start) / V_start. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/returns.py
RollingTotalTurnover
Rolling total (cumulative sum) turnover over a lookback window. Computes the sum of all single-tick turnover values within the rolling window: total_turnover = sum(turnover_values). Useful for measuring total portfolio rebalancing activity over a given period. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/turnover.py
RollingTurnover
Rolling average turnover over a lookback window. Computes the mean of single-tick turnover values within the rolling window: avg_turnover = mean(turnover_values) over valid (non-NaN) observations. Requires pre-computed single-tick turnover values as input (from the Turnover operator). Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/turnover.py
RollingVaR
Rolling Value at Risk (VaR) over a lookback window. Computes the historical VaR at a given confidence level using the empirical quantile of returns: VaR_alpha = percentile(returns, alpha * 100). Represents the maximum expected loss at the (1 - alpha) confidence level. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/risk.py
RollingVolatility
Rolling annualized volatility over a lookback window. Computes the annualized standard deviation of period returns within the rolling window: vol = std(returns) * sqrt(periods_per_year), where returns are simple percentage changes between consecutive equity values. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/volatility.py
RollingWinRate
Rolling win rate over a lookback window. Computes the fraction of positive returns within the rolling window: win_rate = count(returns above 0) / count(returns). Values range from 0.0 (all losing periods) to 1.0 (all winning periods). Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/rolling/trade_stats.py
Turnover
Single-tick portfolio turnover computed incrementally in O(1) per tick. Computes turnover as half the sum of absolute weight changes between the current and previous tick: turnover_t = sum(|w_t - w_{t-1}|) / 2. Stores previous weights internally for comparison. A turnover of 1.0 means the entire portfolio was replaced. Role:METRIC | Ephemeral: No
Parameters
Usage
Source Code
Fullcompute() implementation — no hidden logic.
apps/trading/operators/metrics/accum/turnover.py
Related Pages
STATE Principle
How metrics access portfolio state
Backtesting Overview
Using metrics to evaluate backtest results

