Skip to main content

Overview

This page documents 4 operators (role: various).

Quick Reference


IntervalGate

Time-based gate that opens on timeframe boundaries. Outputs 1.0 when the current timestamp falls on a specified interval boundary, and 0.0 otherwise. Used to control execution frequency of operators that lack internal data aggregation (e.g., WebSearch, LLM). The gate checks whether the timestamp is aligned to the interval grid. Formula: output = 1.0 if timestamp % interval == 0, else 0.0 Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: operator/interval_gate.py

Resample

Time-axis compression (1m -> 1h, 1d, etc.). Converts higher-frequency data to lower-frequency by aggregating ticks at time boundaries. The Graph detects boundaries using timestamp.floor(rule) and passes is_boundary via context. Why timeframe in Input matters: Graph uses Input.timeframe to:
  1. Validate timeframe compatibility between connected nodes
  2. Compute required buffer sizes (lookback * timeframe_seconds)
  3. Register resample rules for boundary detection
Even if your data source is 1m, you can build indicators on any higher timeframe by chaining Resample. Multi-timeframe pattern:

Raw 1m data -> 1h candles -> indicators on 1h

graph.add_node(“close_1h”, Resample( input=Input(“FIELD:close”, timeframe=“1m”), rule=“1h”, method=“last”, )) graph.add_node(“sma_1h”, SMA( Input(“close_1h”, timeframe=“1h”, lookback=20), period=20, ))

4h from the same 1m source

graph.add_node(“close_4h”, Resample( input=Input(“FIELD:close”, timeframe=“1m”), rule=“4h”, ))

Volume bars (sum aggregation)

graph.add_node(“vol_1h”, Resample( input=Input(“FIELD:volume”, timeframe=“1m”), rule=“1h”, method=“sum”, )) Available aggregation methods:
  • “last”: Last value in window (default, for close prices)
  • “first”: First value (for open prices)
  • “mean”: Average (for indicators)
  • “sum”: Sum (for volume)
  • “min”: Minimum (for low prices)
  • “max”: Maximum (for high prices)
  • “ohlc”: Full OHLC (returns close as main value)
Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: operator/resample.py

Identity

Pass through the most recent tick unchanged. Returns the latest data slice without any transformation. Commonly used to alias FIELD inputs under shorter node names for cleaner graph definitions, or to adapt input specifications. Formula: result = x[t] (identity function, no transformation) Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: operator/utility.py

Constant

Emit a fixed constant value at every time step. Produces a TaggedArray filled with the specified constant value, shaped to match the input dimensions. Useful for thresholds, scaling factors, or any fixed parameter in the computation graph. Formula: result = c (constant for all elements) Role: UNKNOWN | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: operator/utility.py

Operator Protocol

How operators implement the compute() interface

StatefulGraph

How operators compose into a DAG