OR
systemic:core-orLogicInputs
| Name | Type | Description |
|---|---|---|
| First Flag | True/false series | The first true/false series to combine. |
| Second Flag | True/false series | The second true/false series to combine. |
Outputs
| Name | Type | Description |
|---|---|---|
| OR | True/false series | `true` on each bar where at least one of the two flags is `true`. |
Cost
0.2 + 0.00493·n credits for n bars, rounded up. The marks are each plan's limit of bars.
The OR module combines two boolean series bar by bar. 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: an empty (null) input makes the result empty only when the outcome depends on it. One true decides the result on its own, even if the other flag is empty. A false decides nothing on its own, because the missing flag could have been true, so the result is empty.
| A | B | A OR B |
|---|---|---|
| true | empty | true |
| empty | true | true |
| false | empty | empty |
| empty | false | empty |
| empty | empty | empty |
An empty flag is never treated as false: a gap in your data, such as a closed market or an indicator warm-up, stays a gap in the signal on the same bar. Every bar where both flags are present gives a real true or false.
Numeric Interpretation
⚠️ Important: When inputs are numeric rather than boolean, the OR module converts each value before combining:
| 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 each input separately.
Input Alignment
When inputs have different lengths or periods, Systemic matches them by time:
| Scenario | Behavior |
|---|---|
| Different lengths | The result starts at the first bar where both inputs have data |
| Different periods | The series with the longer period repeats its latest value on each bar of the other |
Practical Example
Multiple entry signals: Raise a buy signal when either RSI is oversold or MACD crosses above its signal line. This strategy reacts to any bullish indicator, while AND requires all conditions at once.
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 that produce boolean conditions