OR
systemic:core-orLogicfunction1 crInputs
| Name | Type | Description |
|---|---|---|
| First Flag | booleanarray | The first boolean series for disjunction. |
| Second Flag | booleanarray | The second boolean series for disjunction. |
Outputs
| Name | Type | Description |
|---|---|---|
| OR | booleanarray | The element-wise logical OR result. |
The OR module performs element-wise logical disjunction on two boolean series. It returns true if at least one of the inputs is true.
| A | B | A OR B |
|---|---|---|
| false | false | false |
| false | true | true |
| true | false | true |
| true | true | true |
Missing Data
OR uses three-valued logic: a missing (null) input only makes the result null when the outcome genuinely depends on it. One real true decides a disjunction outright, even if the other flag is missing. A false decides nothing on its own — the missing partner could have been true — so the result is null.
| A | B | A OR B |
|---|---|---|
| true | null | true |
| null | true | true |
| false | null | null |
| null | false | null |
| null | null | null |
A missing flag is never treated as false: a gap in your data — a closed market, an indicator warm-up — stays a gap in the signal, at the same position. OR itself has no invalid inputs: every position where both flags are present produces a real true/false.
In LIVE mode the module returns exactly one datapoint — the current bar — which is null when it is undeterminable by the rules above.
Numeric Interpretation
⚠️ Important: When inputs are numeric rather than boolean, the OR module converts values before evaluating:
| Value | Interpreted As |
|---|---|
| 0 | false |
| 0.0 | false |
| 1 | true |
| -5 | true |
| 0.001 | true |
Rule: Zero is false. Any non-zero value is true. This applies to both inputs independently.
Input Alignment
When inputs have different lengths or frequencies, Systemic automatically aligns them:
| Scenario | Behavior |
|---|---|
| Different lengths | Shorter series is padded by repeating its last value |
| Different frequencies | Lower-frequency series is upsampled to match |
Practical Example
Multiple entry triggers: Fire a buy signal when either RSI is oversold or MACD crosses above its signal line. This creates a more aggressive strategy that reacts to any bullish indicator, in contrast to AND which requires all conditions.
Comparison: OR vs AND
| Operator | Behavior | Use When |
|---|---|---|
| OR | True if any input is true | Inclusive criteria, alternatives |
| AND | True only if all inputs are true | Strict filtering, confirmation |
Related Modules
- AND — Logical conjunction (both must be true)
- NOT — Logical negation (invert a condition)
- EQ — Equality comparison
- GTR / LST — Comparison operators for generating boolean conditions