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.
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
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.
✨ 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:
Examplepred, representing the model prediction.rsi and macd.3.1.2 Entry and exit conditions
Every condition is optional, but at least one entry condition is required.| Parameter | Description | Example |
|---|---|---|
| Open long | Triggers a long entry | rsi < 30 |
| Open short | Triggers a short entry | rsi > 70 |
| Close long | Closes a long position | rsi > 50 |
| Close short | Closes a short position | rsi < 50 |
• Open long: enter when the long-entry condition is met.
• Close long: exit when the long-exit condition is met.
• Open short: enter when the short-entry condition is met.
• Close short: exit when the short-exit condition is met.
Open long: rsi < 30
Close long: rsi > 70
Open short: rsi > 80
Close short: rsi < 20
Open long: (pred > 0.6) & (close > ma20)
Close long: pred < 0.4
Open short: (pred < 0.3) & (close < ma20)
Close short: pred > 0.5
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.
# Data processing: precompute
golden = ta_cross_over(ma5, ma20)
# Strategy: reference the column
Open long: golden == True
or: golden & (rsi < 30)
# 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
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.3.2.2 Selection short
Selects the N lowest-scoring instruments and goes short.3.2.3 Long/short hedge
Goes long the Top N and short the Bottom N simultaneously for market-neutral hedging.4. Output data structure
The strategy node adds trading-signal columns to its input.
| Column | Type | Source | Description |
|---|---|---|---|
| datetime | datetime | Passed through | Timestamp |
| symbol | string | Passed through | Trading symbol |
| [existing columns...] | various | Passed through | OHLCV, factors, predictions, and so on |
| trading signal | int | Added | Signal: 1 = long, -1 = short, 0 = no signal |
| position weight | float | Added | Position weight for instrument-selection strategies |