AND
systemic:core-andLogicInputs
| 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 |
|---|---|---|
| AND | True/false series | A true/false series that is `true` on the bars where both input flags are `true`. |
Cost
0.198 + 0.00499·n credits for n bars, rounded up. The marks are each plan's limit of bars.
The AND module combines two true/false (boolean) series bar by bar. The output is true only when both inputs are true.
| A | B | A AND B |
|---|---|---|
| false | false | false |
| false | true | false |
| true | false | false |
| true | true | true |
Missing Data
A flag can be missing (empty) — a data gap, or a bar when the market was closed, such as a weekend on a stock series. AND never fills in a value for such a bar:
| A | B | A AND B |
|---|---|---|
| false | missing | false |
| missing | false | false |
| true | missing | empty |
| missing | true | empty |
| missing | missing | empty |
A false on either side settles the answer: the output is false whatever the missing flag would have been. In every other case the result depends on the missing value, so the output is empty on that bar. The series keeps its full length.
AND has no invalid inputs, so an empty output always means "cannot be decided on this bar", never a math error.
Numeric Interpretation
Important: When inputs are numeric rather than boolean, the AND module converts the values first:
| 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 the inputs have different lengths or periods, Systemic aligns them automatically:
| Scenario | Behavior |
|---|---|
| Different lengths | The result starts at the first bar where both series have data |
| Different periods | The series with the longer period repeats its latest value on every bar of the shorter period |
Example: A daily signal combined with an hourly signal → the latest daily value is repeated on every hourly bar until the next daily value arrives.
Practical Example
Multi-condition signal: Flag a bar only when RSI shows oversold and price is above the 200-day moving average. Both conditions must be true on the same bar. This gives fewer false signals than either condition alone.
Related Modules
- OR — True when either input is true
- NOT — Inverts a boolean series
- EQ — Tests equality between values