Not¶
Signals · Logic
Invert a boolean signal.
Not inverts a boolean signal: true becomes false, false becomes true. It's the small but essential logic block that lets you express "when this is not the case" — trade only when the market is not in a high-volatility regime, enter only when price is not in premium, and so on.
How it works¶
The block takes a single boolean In signal and outputs its opposite on every bar. That's all — one input, one inverted output.
When to use it¶
Use Not to flip a condition without building a separate inverse comparison. It's cleanest when the condition you have is naturally expressed one way but you want the other side: invert an "in premium" signal to get "not in premium" for long entries, or invert a "trending" flag to find ranging conditions. Combined with And, it's how you add exclusion rules: "enter long AND NOT in an exhausting regime."
Example¶
Exclude a bad regime: take a Volatility Regime "exhausting" condition (built with Equal against the exhausting code), invert it with Not to get "not exhausting," and And it with your entry so you never enter into a blow-off. Route to a Buy Signal and backtest in the Tester.
Tips & gotchas¶
- One in, one out — the simplest gate, but it keeps logic readable.
- Great for exclusion rules in an And chain ("… AND NOT …").
- Inverting a state stays a state; inverting an event is rarely what you want (it'd be true on every non-event bar).
- Double-check intent — "not oversold" includes both neutral and overbought; sometimes you want a specific range via Between.
Related blocks¶
Inputs¶
| Socket | Type | What to wire in |
|---|---|---|
| In | signal |
Signal to invert |
Outputs¶
| Output | Type | Plots as | Description |
|---|---|---|---|
| Result | signal |
Signal arrows | Combined boolean signal |
Reference auto-generated from the block catalog · category Signals.