Skip to main content

Overview

ClyptQ provides prebuilt operators organized across 14 roles. Every operator follows the same protocol: receive TaggedArray inputs, return TaggedArray outputs. The StatefulGraph handles all state management, buffering, and execution ordering.

Operator Roles

Operator Protocol

Every operator implements a single method:
Key rules:
  1. Stateless — Operators must not store mutable state between ticks. The graph manages all state via RollingBuffers
  2. TaggedArray in, TaggedArray out — All inputs and outputs are TaggedArrays with 4 fields (value, exists, valid, updated)
  3. Declare inputs upfront — Each input is declared via Input(source, timeframe, lookback, gaps) at graph registration time

Input Specification

Gap modes explained:
  • "nan" — Default. Optimal for 24/7 markets (crypto). All rows kept, non-existing rows have exists=False.
  • "skip" — For markets with regular gaps (US stocks, forex). Returns only rows where exists=True. The buffer allocates extra headroom to ensure lookback valid rows.
  • "ffill" — For sparse data (macro indicators, monthly releases). Forward-fills gap rows with the last valid value.
The gaps="skip" and gaps="ffill" modes are implemented and production-ready. "skip" is designed for US stock data (weekday-only trading), but since stock data collection is not yet deployed to production, it has not been exercised at scale. "nan" (the default) is used by all current crypto production strategies. Once stock data is onboarded, no operator changes are needed — only the gaps parameter on the Input spec.
See Lookback Buffers — Gap Handling for implementation details.

Category Guide

Indicators

Technical indicators computed from price/volume data.

Moving Averages

SMA, EMA, DEMA, TEMA, WMA, TRIMA, T3, KAMA, MAMA, MA, HMA, FRAMA (12)

Momentum

RSI, MACD, MOM, ROC, CMO, APO, PPO, STOCH, STOCHRSI, WILLR, ULTOSC, BOP, TRIX, CCI, etc. (17)

Trend

ADX, ADXR, AROON, SAR, ICHIMOKU, DI, PLUS_DI, MINUS_DI, etc. (12)

Volatility

ATR, NATR, BBANDS, STDDEV, TRANGE, AVGRANGE (6)

Volume

OBV, AD, ADOSC, MFI, VWAP (5)

Statistics

LINEARREG, BETA, CORREL, VAR, TSF, MINMAX, MEDIAN, etc. (26)

Candlestick Patterns

60 CDL pattern recognizers (CDLDOJI, CDLHAMMER, CDLENGULFING, etc.)

Signals

Alpha signals and factor exposures for portfolio construction.

Alphas

21 alpha signals: Momentum, RSI, Bollinger, Volume, MeanReversion, etc.

Factors

8 cross-sectional factors: Momentum, MeanReversion, Volatility, etc.

Alpha 101

101 formulaic alphas from Kakushadze (2016)

Transforms

Cross-sectional normalization and portfolio optimization.

Scalers

ZScore, Rank, MinMax, L1Norm, L2Norm, Softmax, Clip, Winsorize, etc. (11)

Neutralizers

Demean, Neutralize, BarraNeutralizer, etc. (7)

Optimizers

MVO, RiskParity, EqualWeight, ClipWeights, MaxPositions (5)

Position

WeightsToPositions, TurnoverConstraint, etc. (7)

Universe

Filtering and scoring for tradable asset selection.

Filters

VolumeFilter, VolatilityFilter, PriceFilter, CompositeFilter (6)

Scores

VolumeScore, LiquidityScore, VolatilityScore (3)

Metrics, Balance, Order, Semantic, Control

Metrics

Rolling (17) + Accumulative (16) performance metrics

Balance

Cash, equity, positions, margin queries via STATE

Order

Spot, futures, arbitrage intention generation

Semantic

LLM scoring, web search, sentiment (ephemeral)

Control

Conditional gates, AND/OR combinators

Utility

Identity, Resample, FieldMerge, SymbolSelect/Drop

Writing Custom Operators

Basic Structure

Registering in a Graph

Handling TaggedArray Masks

Ephemeral Operators

Operators that call external APIs (LLM, web search) are marked ephemeral:
Ephemeral operators skip backtest validation and only run in paper/live mode.

Relationship to Other Concepts