Tool
Compare
condition.compare
Inputs
The first operand — usually the number line you are testing: an oscillator, an indicator reading, or a computed series. Can also be a fixed literal or a module input.
The second operand — the level or series to compare against. Type a fixed number for a classic threshold, or wire another series for a series-vs-series comparison.
The third operand — appears when operand_count ≥ 3. With mode ≤, a ≤ b ≤ c makes b's position inside the [a, c] band a single node.
The fourth operand — appears when operand_count ≥ 4; the chain adds the c-to-d comparison.
The fifth operand — appears when operand_count = 5; the chain adds the d-to-e comparison.
Outputs
A boolean that is true on each bar where every adjacent comparison in the chain holds, and false otherwise — including every bar where a compared value is NaN.
Compare is the one gate for every numeric comparison: pick an operator (>, ≥, <, ≤, =, ≠) and it fires true on each bar where the comparison holds. Chain up to five operands and it reads like math — a < b < c means “b sits inside the band”.
How it works
Wire a number line into `a` and give it something to compare against — type a fixed level into `b`, bind it to a module input, or wire a second series. The mode picker chooses the operator; with operand_count above 2 the node checks every adjacent pair (a < b, then b < c, …) and outputs true only when ALL of them hold. Equality modes (=, ≠) compare within the epsilon tolerance. A bar where any compared value is NaN never fires — warmup bars can't sneak through a gate.
Modes
Mode options
True where the left operand is strictly above the right one.
When to use: The classic strength gate — RSI > 60, ADX > 25, volume ratio > 1.5.
True where the left operand is above or exactly at the right one.
When to use: Like >, but the boundary bar itself also fires — use when hitting the level counts.
True where the left operand is strictly below the right one.
When to use: The oversold / quiet-market gate — RSI < 30, ADX < 20, spread < a cap.
True where the left operand is below or exactly at the right one.
When to use: Like <, with the boundary included. With 3 operands, a ≤ b ≤ c is an inclusive range check.
True where the two operands differ by no more than epsilon.
When to use: Match a computed level or index — keep a small epsilon so float noise doesn't break the match.
True where the two operands differ by more than epsilon; NaN never counts as different.
When to use: The nonzero test: ≠ against a fixed 0 turns any number line into a true/false line.
Operand count options
Configuration
The comparison operator applied to each adjacent operand pair: gt (>), ge (≥), lt (<), le (≤), eq (= within epsilon), ne (≠ outside epsilon).
How many operand slots are live, from 2 to 5. The node chains the comparison across every adjacent pair — with 3 operands and mode ≤, a ≤ b ≤ c is a one-node range check; hidden slots are ignored even if wired.
Tolerance for the equality modes: = fires when the pair differs by no more than epsilon, ≠ when it differs by more. Keep a tiny positive value to compare floats safely; 0 makes ≠ an exact nonzero test.
Connects to
Examples
- Overbought gate: wire RSI into a, type 70 into b, mode gt — fires only while momentum is stretched.
- Range check: mode le with operand_count 3 — type 40 into a, wire RSI into b, type 60 into c to pass only while RSI sits in the 40–60 band.
- Nonzero cast: mode ne with b = 0 and epsilon 0 turns any numeric series into a clean true/false line.
Common mistakes
- Expecting > to fire when the value exactly equals the level — the strict modes exclude the boundary; use ≥ / ≤ when the exact touch should count.
- Using ≠ with a large epsilon and reading it as “not exactly equal” — ≠ fires only when the pair differs by MORE than epsilon.
- Chaining 3+ operands and expecting every pair to be compared — only ADJACENT pairs are tested (a vs b, b vs c), never a vs c.