Strategy type node

1. Node overview

The strategy type node is the core signal generator. It defines when to trade and what to trade. BeeQuant supports two primary strategy types: timing strategies, which use conditional expressions to determine entries and exits, and instrument-selection strategies, which rank factors to select instruments. The node receives data from a data processing node or AI model node and outputs trading signals for position management.

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

Determines entries and exits with conditions

Suitable for one or a small number of instruments

Supports both long and short trading

Settings: open long, open short, close long, and close short condition editors

Instrument-selection strategy

Selects instruments by factor or model-score ranking

Periodically reranks and rebalances the selected instruments

Three subtypes: selection long, selection short, and long/short hedge

Two allocation modes: equal weight and top-focused

2. Interactive configuration

The panel below is the actual strategy type configuration. Switch the strategy type to explore each interface.

Strategy type configuration

✨ Upstream variables available in expressions:

4 total

💡 All conditions are optional, but at least one entry condition is required. The editor supports autocomplete and syntax validation.

3. Strategy types

Choose between a timing strategy and an instrument-selection strategy. Timing is the default.

3.1 Timing strategy

Uses conditions to determine entries and exits; suitable for one or a small number of instruments.

A timing strategy defines entry and exit timing through conditional expressions. A condition that evaluates to True triggers the corresponding signal. Both long and short trading are supported, with separate entry and exit conditions for each direction.

3.1.1 Upstream variables

The system detects upstream variables automatically so they can be referenced directly.

✨ Upstream variables detected and available in expressions:

Example
predrsimomentumma5ma20
AI prediction columns
Outputs from an AI model node, usually named pred, representing the model prediction.
Factor variables
Factors from a data processing node, including technical indicators such as rsi and macd.
Tip: Click a variable tag to copy it for pasting into the expression editor. If no variables are found, verify that upstream nodes are connected and configured correctly.

3.1.2 Entry and exit conditions

Every condition is optional, but at least one entry condition is required.
💡 Tip: The editor supports code completion and syntax validation.
ParameterDescriptionExample
Open longTriggers a long entryrsi < 30
Open shortTriggers a short entryrsi > 70
Close longCloses a long positionrsi > 50
Close shortCloses a short positionrsi < 50
Long logic

Open long: enter when the long-entry condition is met.

Close long: exit when the long-exit condition is met.

Short logic

Open short: enter when the short-entry condition is met.

Close short: exit when the short-exit condition is met.

Common strategy examples
RSI overbought/oversold

Open long: rsi < 30

Close long: rsi > 70

Open short: rsi > 80

Close short: rsi < 20

AI prediction + trend confirmation

Open long: (pred > 0.6) & (close > ma20)

Close long: pred < 0.4

Open short: (pred < 0.3) & (close < ma20)

Close short: pred > 0.5

🚫 Important limitation: operator functions cannot be called in strategy conditions

Conditions support column references, comparisons, and logical operations only. They do not support time-series operators such as ta_ma, shift, or ta_cross_over.

At runtime a condition receives only the latest row for each instrument. Operators that require history return NaN from insufficient data, so their conditions never trigger.

✅ Correct

# Data processing: precompute

golden = ta_cross_over(ma5, ma20)

# Strategy: reference the column

Open long: golden == True

or: golden & (rsi < 30)

❌ Incorrect

# Calling operators directly in a condition

Open long: ta_cross_over(ma5, ma20)

Open long: shift(close, 1) < close

Open long: ta_rsi(close, 14) < 30

Expression syntax: Conditions support comparison and logical operations and may reference factors defined by upstream data processing nodes or AI predictions such as pred. Boolean columns may be used directly, as in golden, or compared explicitly, as in golden == True. Operator functions are available only in data processing.

3.2 Instrument-selection strategy

Ranks instruments by a factor or model score and rebalances them periodically.

The strategy ranks every instrument by a chosen field and has three subtypes: selection long, selection short, and long/short hedge. All three rerank and rebalance at the configured interval. Rebalancing updates the held instruments; it never switches the strategy direction between long and short. Crypto markets differ from equity markets, so the effectiveness of cross-sectional ranking strategies must be validated through backtesting and the results evaluated carefully.

3.2.1 Selection long

Selects the N highest-scoring instruments and goes long.
Selection:Top N (highest scores)
Direction:All long
Use case:Long strong instruments
3.2.1.1 Equal-weight mode
Allocation mode = Equal weight — every selected instrument receives the same weight.
1. Allocation mode
Equal allocation gives every selected instrument the same position weight.
2. Instruments per selection: Top
Go long the N highest-scoring instruments; a value of 5 selects the Top 5.
3. Rebalance interval
Recalculate selections every N candlesticks; 1 means every candlestick.
4. Rebalance ratio
Maximum share of position value that may be adjusted per rebalance; 0.2 means 20%.
5. Ranking field
Field used to rank instruments, from an upstream factor or AI prediction. Long selects the highest values.
6. Conditional filter (optional)
Filter eligible instruments before ranking, for example rsi > 50.
Equal-weight allocation (5 selected assets)
Asset 1
20%
Asset 2
20%
Asset 3
20%
Asset 4
20%
Asset 5
20%
✓ Diversified risk ✓ Simple and intuitive ✓ Beginner-friendly
3.2.1.2 Top-focused mode
Allocation mode = Top focused — higher-ranked instruments receive more weight, with concentration controlled by the temperature.
1. Allocation mode
Top focused; the first-ranked instrument receives the largest weight.
2. Temperature
Controls concentration. Lower values give the leaders more weight; higher values approach equal weight. Options: 1.0 / 2.0 / 3.0 / 5.0.
3. Instruments per selection: Top
Go long the N highest-scoring instruments.
4. Rebalance interval
Recalculate selections every N candlesticks.
5. Rebalance ratio
Maximum share of position value adjusted per rebalance.
6. Ranking field
Field used to rank instruments. Long selects the highest values.
7. Conditional filter (optional)
Filter eligible instruments before ranking.
Effect of temperature on allocation
Temperature = 1 (Concentrated)
#1
33%
#2
20%
#3
17%
#4
16%
#5
15%
Temperature = 2 (Default)
#1
26%
#2
20%
#3
19%
#4
18%
#5
17%
Temperature = 5 (Near equal weight)
#1
22%
#2
20%
#3
20%
#4
19%
#5
19%
Top-focused allocation (temperature = 2.0, 5 assets)
Asset 1
26%
Asset 2
20%
Asset 3
19%
Asset 4
18%
Asset 5
17%
✓ Concentrated returns ⚠ Concentrated risk ✓ Suitable for strong factors

3.2.2 Selection short

Selects the N lowest-scoring instruments and goes short.
Selection:Bottom N (lowest scores)
Direction:All short
Use case:Short weak instruments
3.2.2.1 Equal-weight mode
Allocation mode = Equal weight — all selected instruments receive the same weight.
1. Allocation mode
Equal-weight allocation.
2. Instruments per selection: Top
Short the N lowest-scoring instruments; a value of 5 selects the Bottom 5.
3-6. Other settings
Rebalance interval, rebalance ratio, ranking field, and conditional filter are configured as for long mode, except short selects the lowest values.
Equal-weight allocation (5 selected short assets)
Asset 1
20%
Asset 2
20%
Asset 3
20%
Asset 4
20%
Asset 5
20%
✓ Diversified risk ✓ Simple and intuitive ✓ Beginner-friendly
3.2.2.2 Top-focused mode
Allocation mode = Top focused — assets nearer the top of the short ranking, with lower scores, receive more weight.
1. Allocation mode
Top focused; the lowest-scoring asset receives the largest short weight.
2. Temperature
Controls concentration; lower values give the leaders more weight, while higher values approach equal weight.
3-7. Other settings
Selection count, rebalance interval, rebalance ratio, ranking field, and conditional filter are configured as in long top-focused mode.
Top-focused allocation (temperature = 2.0, 5 short assets)
Asset 1
26%
Asset 2
20%
Asset 3
19%
Asset 4
18%
Asset 5
17%
✓ Concentrated returns ⚠ Concentrated risk ✓ Suitable for strong short factors

3.2.3 Long/short hedge

Goes long the Top N and short the Bottom N simultaneously for market-neutral hedging.
Long selection:Top N long
Short selection:Bottom N short
Use case:Market-neutral hedge
Characteristics: Long and short positions hedge broad market movement. Ideally, returns come from the relative performance between the two sides rather than market direction. Conditional filtering is unavailable in neutral mode because it can break the hedge.
3.2.3.1 Equal-weight mode
Allocation mode = Equal weight — each side is allocated equally.
1. Allocation mode
Equal weights, with 50% allocated to each side.
2. Instruments per side (Top/Bottom N)
Long the highest N and short the lowest N, for 2N positions in total.
3-5. Other settings
Rebalance interval, rebalance ratio, and ranking field; long selects the highest and short selects the lowest.
Long side (Top 5, 50% total)
Asset 1
10%
Asset 2
10%
Asset 3
10%
Asset 4
10%
Asset 5
10%
Short side (Bottom 5, 50% total)
Asset A
10%
Asset B
10%
Asset C
10%
Asset D
10%
Asset E
10%
✓ Long/short balance ✓ Diversified risk ✓ Suitable for range-bound markets
3.2.3.2 Top-focused mode
Allocation mode = Top focused — each side concentrates weight in its leaders.
1. Allocation mode
Top focused; the leading instruments on both sides receive more weight.
2. Temperature
The same temperature is applied to both long and short sides.
3-6. Other settings
Instruments per side, rebalance interval, rebalance ratio, and ranking field; long selects the highest and short selects the lowest.
Long side (top focused, 50% total)
Asset 1
13%
Asset 2
10%
Asset 3
9%
Asset 4
9%
Asset 5
9%
Short side (top focused, 50% total)
Asset A
13%
Asset B
10%
Asset C
9%
Asset D
9%
Asset E
9%
✓ Concentrated returns ✓ Long/short hedge ⚠ Requires a strong factor

4. Output data structure

The strategy node adds trading-signal columns to its input.

ColumnTypeSourceDescription
datetimedatetimePassed throughTimestamp
symbolstringPassed throughTrading symbol
[existing columns...]variousPassed throughOHLCV, factors, predictions, and so on
trading signalintAddedSignal: 1 = long, -1 = short, 0 = no signal
position weightfloatAddedPosition weight for instrument-selection strategies
Signal meanings
signal = 1
Long signal
signal = -1
Short signal
signal = 0
No signal / close position

5. FAQ

Q: Should I choose a timing or instrument-selection strategy?
A: Use timing when trading one or a small number of instruments and control entries and exits with conditions. Use selection when ranking multiple instruments and rebalancing the selected holdings. They can also be combined: use timing for broad direction, then selection for specific instruments.
Q: Where does the ranking field come from?
A: Usually from upstream: (1) a factor such as rsi or momentum from data processing, or (2) an AI prediction such as pred. Available variables are detected and displayed automatically.
Q: Why is conditional filtering unavailable for a market-neutral strategy?
A: Neutral strategies must select both the best and worst instruments for hedging. A filter might remove the poor instruments that should be shorted and break the hedge. Apply any required filtering in data processing instead.
Q: How do equal-weight and top-focused modes differ?
A: Equal weight assigns the same allocation to every selection, diversifying risk but potentially diluting returns. Top focused gives more weight to higher-ranked selections, concentrating both return and risk. Lower temperature means greater concentration. Beginners should start with equal weight.
Q: Does a rebalance interval of 1 trade too frequently?
A: It recalculates holdings every candlestick, but actual trades depend on changes in the target holdings. Unchanged selections do not trade. Increase the interval or use the rebalance ratio to reduce turnover.
Q: How should I choose the temperature?
A: 1.0 is the most concentrated option; 2.0 is the balanced default; 5.0 is closer to equal weight. A stronger predictive factor may justify a lower temperature to increase exposure to the leaders.
Q: What does the rebalance ratio do?
A: It caps the amount adjusted in one rebalance. A value of 0.2 permits at most 20% of total holdings to change, smoothing position updates and reducing impact cost. A value of 1.0 allows a full rebalance to the new signal.
Q: Which variables can a conditional filter use?
A: Any upstream variable: base OHLCV fields, factors defined in data processing, and AI predictions such as pred. The editor suggests available variables automatically.
Q: Can long and short strategies run together?
A: A standard workflow uses one strategy node. To manage both sides, set the instrument-selection subtype to long/short hedge; that single strategy node goes long high-scoring instruments and short low-scoring instruments.
    BeeQuant - AI Quantitative Trading Platform