Skip to main content

Overview

This page documents 7 operators (role: various).

Quick Reference


Demean

Remove cross-sectional mean from signal values. Subtracts the mean of all valid symbol values, centering the cross-section around zero. This is the simplest form of neutralization, removing the common level across symbols. Formula: result_i = x_i - mean(x) Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: apps/trading/operators/transform/neutralizers.py

Neutralize

Neutralize signal to zero mean with optional unit-variance scaling. Removes the cross-sectional mean and optionally divides by the cross-sectional standard deviation to produce a zero-mean, unit- variance signal. When scale is False, only demeaning is applied. Formula: result_i = (x_i - mean(x)) / std(x) [when scale=True] Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: apps/trading/operators/transform/neutralizers.py

GroupNeutralize

Neutralize signal within groups such as sectors or categories. Demeans each symbol within its assigned group so that every group has zero mean exposure. Symbols not found in the mapping are assigned to the “Unknown” group. Formula: result_i = x_i - mean(x_g), where g is the group of symbol i. Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: apps/trading/operators/transform/neutralizers.py

BetaNeutralize

Neutralize market beta exposure from a signal. Removes the beta-weighted market component from each symbol’s value. Computes the beta-weighted average signal and subtracts each symbol’s proportional beta contribution. Formula: adjustment = sum(x_i * beta_i) / sum(beta_i); result_i = x_i - adjustment * beta_i Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: apps/trading/operators/transform/neutralizers.py

FactorNeutralize

Remove multiple factor exposures via OLS cross-sectional regression. Regresses the signal on a matrix of factor exposures (with an intercept) and returns the residuals. This removes any linear dependence on the specified factors. Falls back to simple demeaning if the factor matrix is singular. Formula: alpha = X * beta + residual, where X = [1, factors]; result = alpha - X * (X’X)^{-1} * X’ * alpha Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: apps/trading/operators/transform/neutralizers.py

Normalize

Combined demeaning and L1 normalization to produce dollar-neutral weights. First removes the cross-sectional mean, then scales the result so that the sum of absolute values equals one. This produces a zero-net-exposure, unit-leverage weight vector suitable for long-short portfolios. Formula: demeaned_i = x_i - mean(x); result_i = demeaned_i / sum(|demeaned|) Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: apps/trading/operators/transform/neutralizers.py

BarraNeutralizer

BARRA-style two-stage factor neutralization with rolling estimation. Performs a full BARRA neutralization process in two stages: Stage 1 — Estimate factor loading matrix B via time-series regression: R_i,t = sum(beta_i,k * F_k,t) + epsilon_i,t Stage 2 — Neutralize alpha via cross-sectional regression: alpha_raw = B * gamma + alpha_pure Formula: alpha_pure = alpha_raw - B * (B’B)^{-1} * B’ * alpha_raw Maintains rolling history buffers for loading estimation. Falls back to simple demeaning when insufficient history is available. Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: apps/trading/operators/transform/neutralizers.py

Operator Protocol

How operators implement the compute() interface

StatefulGraph

How operators compose into a DAG