Data processing node

1. Node overview

The data processing node is the strategy's feature-engineering hub and the only node that actually retrieves base market fields (OHLCV). It reads parameters from the upstream data source card, calls exchange APIs to retrieve raw OHLCV and fundamental data, and computes technical indicators and quantitative factors as strategy-ready features. The resulting factors can be used directly in strategy-node conditions or as input features for an AI model node.

Position in the data flow
Data sourceData processingAI modelStrategy typePosition managementRisk controlTrading engine

2. Interactive configuration

The panel below is the actual data processing configuration. Explore its four core sections directly: historical lookback, factor configuration, labeling, and conditional filtering.

Data processing node configuration

Current expressions require at least 0 periods. Nested factors accumulate lookback windows; maximum supported: 10000.

Select preset factors from the library or write custom expressions; both are merged automatically

Factor library
Custom expression

2.1 Historical lookback

Sets the amount of historical data, in periods, required for factor calculations.
What is the historical lookback?
Technical indicators normally require historical observations. A 20-period moving average, for example, needs the closing prices of the preceding 20 candlesticks. This setting controls how many candlesticks the system looks back at each evaluation point. It must be greater than or equal to the largest window in every factor expression; otherwise insufficient data produces NaN values. The default is 100, and the allowed range is 1 - 1000.
Configuration examples
Factor usedLargest windowRecommended value
ta_ma(close, 20)2025-30
ta_ma(close, 60)6070-80
ta_bbands(close, 20, 2)2025-30
t_std(close, 120)120140-150
Recommendation: Allow 10%-20% headroom. If the largest window is 60, use 70-80 to avoid boundary-related NaN values. If unsure, choose a larger value such as 200, at the cost of slightly more computation time.

2.2 Factor configuration

Define quantitative factors from the factor library or with custom expressions.
What is a factor?
A factor is a core quantitative-strategy feature extracted from raw price and volume data. Examples include a 20-period moving average, RSI, and volume ratio. Factors describe market state and help a strategy make decisions, or serve as AI-model input features. Define them either by selecting from the factor library or by writing custom expressions.
Factor library
The library contains common technical indicators that can be added with one click. A selection automatically generates its expression, so no manual code is required. Factors are organized into trend, momentum, volatility, volume, and other categories.
CategoryIncluded indicatorsPurpose
TrendMA, EMA, WMA, MACD, Bollinger BandsDetermine trend direction and strength
MomentumRSI, KDJ, Williams %R, ROC, CCIMeasure the speed of price changes and identify overbought or oversold conditions
VolatilityATR, standard deviation, volatility, true rangeMeasure price variation for risk control
VolumeVolume ratio, OBV, turnover value, turnover rateAnalyze market activity and capital flows
Custom expressions
When the library is insufficient, write expressions with built-in functions and mathematical operators. Use factor_name = expression and separate multiple factors with commas. A name beginning with _ is an intermediate variable used only during calculation and is not emitted. See expression syntax and expression operators.
Example expressionDescriptionOutput
_ma_5 = ta_ma(close, 5)Five-period moving average (intermediate variable)Not emitted
momentum = close / _ma_5 - 1Price deviation from the five-period moving averageEmitted
rsi_14 = ta_rsi(close, 14)Fourteen-period RSIEmitted
vol_ratio = volume / t_mean(volume, 20)Volume ratio: current volume / 20-period average volumeEmitted
volatility = t_std(pct(close, 1), 20)Twenty-period return volatilityEmitted
Common built-in functions
See expression operators for the full list.
Moving averages
ta_ma, ta_ema, ta_wma, t_mean
Momentum indicators
ta_rsi, ta_macd, ta_kdj, ta_cci
Volatility
ta_atr, ta_bbands, t_std
Mathematics
pct, log, abs, max, min, rank, shift
Automatic merge: Library factors and custom expressions are merged and submitted together for backend calculation. Use the library for common indicators and custom expressions for specialized factors at the same time.

2.3 Labeling

Defines optional target data for AI-model training.
What is a label?
A label is the target variable a machine-learning model learns to predict. In quantitative trading it is usually a future return or price change. The model learns the relationship between factors (features) and the label to forecast future movement. Enable labels only for an AI model node such as LightGBM or Transformer. The default is label = shift(close, -5) / shift(open, -1) - 1, the next five-period return measured from the next candlestick's open. For binary classification, the engine converts returns to 0 or 1 using a threshold, 0 by default.
Label expression details
Label expressions normally use shift() to access future data. shift(close, -5) means the closing price five periods later; a negative offset points into the future.
Label expressionMeaningTaskRange
shift(close, -5) / shift(open, -1) - 1Future five-period return from the next candlestick openRegression / binary classification-1 to +∞; converted to 0/1 for binary classification
shift(t_max(high, 5), -5) / shift(open, -1) - 1Maximum upside over the next five periodsRegression-1 to +∞
shift(t_min(low, 5), -5) / shift(open, -1) - 1Maximum downside over the next five periodsRegression-1 to 0
shift(close, -6) / shift(open, -1) - 1Future six-period return; the engine performs the ranking-label conversionRanking-1 to +∞; converted internally for ranking
Variable references

A label expression may reference variables defined earlier in factor configuration.

NaN handling

Shifting into the future creates trailing NaN values, which the system removes automatically.

2.4 Conditional filtering

Optionally retains only rows that meet a condition.
What is conditional filtering?
A filter keeps rows that satisfy a condition and removes the rest before data is sent to downstream AI-model or strategy nodes. Common uses include removing illiquid instruments, excluding invalid data, and restricting price ranges. The default, volume > 1000000, keeps rows whose volume exceeds one million.
Filter examples
A condition returns a Boolean: True keeps the row; False removes it.
ConditionMeaningUse case
volume > 1000000Volume > 1,000,000Remove illiquid instruments
(close > 1) & (close < 100000)Price lies in a reasonable rangeExclude extreme prices
abs(pct(close, 1)) < 0.1Absolute return < 10%Exclude abnormal moves
(rsi > 30) & (rsi < 70)RSI lies between 30 and 70Exclude overbought and oversold regions
vol_ratio > 0.5Volume ratio > 0.5Remove low-volume instruments
~isnan(label)Label is not nullRemove invalid samples
Supported operators
Comparison
>, <, >=, <=, ==, !=
Logical
& (and), | (or), ~ (not)
Functions
abs, isnan, isinf
Reference order: Filters may reference (1) base columns (open/high/low/close/volume/symbol/datetime), then (2) factor variables, then (3) label variables. Every variable defined earlier is available later.
A base column used only in a filter is still retrieved: even if a base column such as marketcap appears only in the filter and not in factors or labels, the engine loads it. Filtering controls rows, however, not output columns. To pass a raw column downstream, assign it explicitly in a factor expression, for example close = close.

3. Output data structure

The output contains only timestamp, symbol, and assigned factor variables whose names do not begin with _. Referencing raw OHLCV does not emit it: raw columns may participate in factors, labels, and filters, but must be passed through explicitly, for example close = close, to appear downstream. The output DataFrame retains the input row count and index structure.

ColumnTypeDescription
timestampdatetimeCandlestick timestamp inherited from input
symbolstringTrading symbol inherited from input
open/high/low/close/volumefloatNot emitted by default, though available in factor, label, and filter expressions. Assign explicitly, such as close = close, to pass downstream.
[factor_name]floatNewly calculated factor column
Example: data after adding MA5, MA20, and RSI factors
Here, close appears only because the factor expression passes it through explicitly with close = close. Without that assignment, the output contains no raw OHLCV columns.
timestampsymbolclosema5ma20rsi
2024-12-11 00:00:00BTCUSDT97800.097650.097120.558.32
2024-12-11 01:00:00BTCUSDT97750.097680.097156.855.18
2024-12-11 02:00:00BTCUSDT97820.097730.097203.259.45
2024-12-11 03:00:00BTCUSDT98050.097810.097268.563.21
2024-12-11 04:00:00BTCUSDT98150.097914.097345.165.87

4. FAQ

Q: What should I do if a factor calculation returns NaN?
A: The historical lookback is usually too short. Moving averages and similar functions return NaN without enough observations. Set the lookback above the largest window; for a 60-period average, use at least 60 and preferably 70-80.
Q: How do factor-library selections and custom expressions work together?
A: They are merged automatically. Library selections generate expressions that are submitted with custom expressions, so you can select common indicators quickly and write specialized factors at the same time.
Q: When should labeling be enabled?
A: Only when using an AI model node, such as LightGBM or Transformer, for machine learning. The label is the training target and defines what the model should predict, such as future return.
Q: Does conditional filtering affect downstream nodes?
A: Yes. Only filtered data is sent downstream to AI-model and strategy nodes. Filters commonly remove illiquid rows, such as volume > 1000000, or invalid data.
Q: How do I reference a calculated factor in a strategy?
A: Use its name directly in the strategy node. If a factor is named momentum, for example, write momentum > 0 in an entry condition.
    BeeQuant - AI Quantitative Trading Platform