
Logical operators combine multiple conditions into a single signal.
Operator | Description | Example |
|---|---|---|
| Logical AND |
|
| Logical OR |
|
Non-zero values are treated as true.
What this unlocks
Multi-factor confirmation systems
Signal confluence modeling
False-positive reduction
Rule-based strategy logic
Logical operators combine multiple binary or numeric conditions into a single executable signal. Any non-zero value is treated as true, zero as false. This allows continuous signals, comparisons, and transformed series to participate directly in logic without extra casting.
Returns 1 only when all conditions are true. Used for confirmation and confluence.
X:BTCUSD.rsi > 70 AND X:BTCUSD.macd > 0logdiff(X:BTCUSD.close) > 0 AND X:BTCUSD.close > ema(X:BTCUSD.close, 50)abs(logdiff(X:BTCUSD.close)) > 0.01 AND X:BTCUSD.volume > ema(X:BTCUSD.volume, 20)Returns 1 when any condition is true. Used for triggers, inclusivity, or early detection.
X:BTCUSD.rsi > 70 OR X:BTCUSD.rsi < 30X:BTCUSD.close == highest(X:BTCUSD.close, 20) OR X:BTCUSD.close == lowest(X:BTCUSD.close, 20)logdiff(X:BTCUSD.close) > 0.02 OR abs(logdiff(X:BTCUSD.close)) > 0.03Build higher-order logic by combining AND and OR in the same expression.
(X:BTCUSD.rsi > 60 AND X:BTCUSD.macd > 0) OR X:BTCUSD.close == highest(X:BTCUSD.close, 50)logdiff(X:BTCUSD.close) > 0 AND (X:BTCUSD.volume > ema(X:BTCUSD.volume, 30))(X:BTCUSD.close > ema(X:BTCUSD.close, 100)) AND (abs(logdiff(X:BTCUSD.close)) < 0.01)Multi-factor confirmation systems Signals only fire when multiple independent conditions align.
Signal confluence modeling Stack momentum, trend, volatility, and volume into one executable rule.
False-positive reduction Require confirmation instead of reacting to single noisy inputs.
Rule-based strategy logic Turn market hypotheses into deterministic, testable structures.
These are not “if statements”. They are numeric time series that can be smoothed, weighted, gated, or composed into regimes.