Rules & Conditions
Almost everything VolNinja does automatically runs on the same idea: a rule. A management rule that takes profit on a position, a template rule that closes a leg, a strategy rule that opens a new trade — they are all built the same way. A rule watches for something to become true, and when it does, it acts.
Because the mechanics are identical everywhere, they are explained once here. The articles for template rules, strategy rules, and a position's own rules cover only what is special about each place; they all point back to this page for how conditions are written.
What a rule is
Every rule has two halves:
- When — one or more conditions. These decide whether the rule should act.
- Then — an action. This decides what happens when the conditions are met.
A plain-English example: When the position's profit reaches 50%, then close it. The "when" is a condition; the "then" is an action. This article is about the first half — how you build conditions — because that part works identically no matter where the rule lives. What actions are available depends on the surface, and each rule article covers its own (closing a position, closing or rolling a leg, opening a template, setting a variable, and so on).
A condition, piece by piece
A single condition compares one thing to another:
a field · an operator · a value (or another field)
- The field is what you're watching — the position's P&L, the underlying price, a leg's delta, the time of day, and many more. Fields come from a searchable catalog, grouped by category, so you pick from what's actually available rather than typing anything by hand.
- The operator depends on the field's type. Numbers offer greater than, less than, equal, and so on; times offer after, before, and at; yes/no fields offer is and is not.
- The value is what you compare against — a fixed number, a time, a yes/no — or you can compare one field to another field (optionally scaled by a multiplier), which is how you say things like "the mark is below 30% of the entry credit."
Two ways to build conditions — simple and advanced
Every rule's conditions start from the same list, headed "When ALL of these are true." As the heading says, the rows are combined with and: the rule acts only when every condition holds. (An empty list reads "No conditions — always matches" — the rule's action would run unconditionally.)

Two buttons sit below the list:
- Add condition — the simple editor, for a single straightforward comparison.
- Advanced expression — the power editor, for anything that needs or, grouping, functions, or arithmetic.
Whichever you use, each finished condition shows up as a plain-language row you can click to edit or remove. You never have to read raw code to know what a rule will do.
Simple conditions
Add condition opens the Edit Condition panel. You choose a Field, pick an Operator, and set what to Compare to — a plain Value, or switch to × field to compare against another field (with an optional multiplier). A live summary at the top restates your condition in words as you build it, so there's no guessing.

Save it and it joins the list as a single readable row. This covers the large majority of real rules — take-profit levels, stop-losses, time-of-day exits — each one a single clear comparison.
Tip
The italic line at the top of the editor is a live preview: it rewrites your condition in plain English as you change the field, operator, or value. If the preview reads the way you'd say it out loud, the condition is right.
Advanced expressions
Some conditions can't be reduced to one row combined with and. When you need "either this or that," grouped logic, a function, or a bit of arithmetic, use Advanced expression to open the Advanced Expression Editor.

Here conditions are built as a small tree of colored tokens:
- A group pill reads ALL of or ANY of — click it to switch a group between and and or. You can nest one group inside another for combinations like "all of these and any of those."
- Each comparison is a row of badges — a field (blue), an operator, and a value (amber) or another field. Click any badge to change it: pick a different field, type a number, wrap it in a function, or apply math (add, subtract, multiply, divide).
- + condition and + group extend the tree; the editor keeps the same live Preview at the top and flags any problems, refusing to save until you Fix errors before saving.
Save condition folds the whole expression back into the rule as one advanced row — still shown in plain language, still one click to reopen.
Using variables in conditions
Inside a strategy, the field catalog also includes the strategy's variables — values you define and maintain yourself, plus shared global ones — right alongside the market and position fields. That lets a condition compare a live value to a threshold you control and can change in one place, rather than editing every rule. See strategy variables for how to define and use them.
Field reference
This is the full catalog of fields you can build conditions on. You never type these — you pick them from the searchable list, grouped by category. The picker only offers the fields that apply where you are: a position's or template's rules see the position and leg fields; a strategy's rules see the account and portfolio fields; the market and time fields are available everywhere.
Types decide which operators you get: Number fields offer the full set of comparisons (greater than, less than, equal…); Yes/No and C or P fields offer only is / is not; Time fields offer after, before, and at.
Position fields
Available in a position's rules and a template's rules.
| Field | Type | What it means |
|---|---|---|
| P&L % | Number | Profit or loss as a percentage of the premium paid or received at entry. |
| P&L $ | Number | Profit or loss in dollars. |
| Delta | Number | Net position delta — its share-equivalent directional exposure. |
| Entry Price | Number | Net premium received or paid when the position opened. |
| Current Price | Number | Current mid-market value of the position. |
| Current Price (Bid) | Number | Current bid-side value of the position. |
| Current Price (Ask) | Number | Current ask-side value of the position. |
| Hours Open | Number | Hours elapsed since the position opened. |
| Minutes Open | Number | Minutes elapsed since the position opened. |
| Open Legs | Number | How many of the position's legs are still open. |
Leg fields
Available in a position's rules and a template's rules. Choosing a leg field also asks you to pick which leg it refers to.
| Field | Type | What it means |
|---|---|---|
| P&L % | Number | The leg's profit or loss as a percentage of its entry premium. |
| P&L $ | Number | The leg's profit or loss in dollars. |
| Delta | Number | The leg's current delta. |
| Gamma | Number | The leg's current gamma. |
| Theta | Number | The leg's current theta. |
| Vega | Number | The leg's current vega. |
| IV | Number | The leg's current implied volatility. |
| Strike | Number | The leg's strike price. |
| Price | Number | The leg's current mid price. |
| Bid | Number | The leg's current bid price. |
| Ask | Number | The leg's current ask price. |
| Entry Price | Number | The price the leg filled at when it opened. |
| Type (C/P) | C or P | Whether the leg is a call or a put. |
| Is Open | Yes/No | Whether the leg is currently open. |
Market & time fields
Available everywhere.
| Field | Type | What it means |
|---|---|---|
| Last | Number | Last traded price of the underlying. In a strategy, each supported symbol appears by name (for example, SPX · Last). |
| Close | Number | The underlying's previous-session closing price. |
| Current Time | Time | The current time in ET, on a 24-hour clock. |
| Minutes Since Open | Number | Minutes elapsed since the 9:30 AM ET open. |
| Day of Week | Number | The weekday, where 0 = Monday through 4 = Friday. |
| Market Open | Yes/No | Whether the market is currently open. |
Account fields
Available in a strategy's rules.
| Field | Type | What it means |
|---|---|---|
| Total Equity | Number | Total account equity. |
| Cash Balance | Number | Cash balance in the account. |
| Buying Power | Number | Available buying power. |
| Excess Liquidity | Number | Equity minus maintenance margin. |
| Maintenance Margin | Number | Maintenance margin requirement. |
| Initial Margin | Number | Initial margin requirement. |
| Margin Cushion | Number | Buffer above the maintenance-margin requirement. |
| Unrealized P&L | Number | Unrealized profit or loss reported by the broker. |
| Realized P&L | Number | Realized profit or loss reported by the broker. |
| Daily P&L | Number | Day's profit or loss reported by the broker. |
Portfolio fields
Available in a strategy's rules — these summarize all your open positions at once.
| Field | Type | What it means |
|---|---|---|
| Open Positions | Number | How many positions are currently open. |
| Total Unrealized P&L | Number | Unrealized profit or loss summed across all open positions. |
| Total Realized P&L | Number | Profit or loss from positions closed today. |
| Day P&L | Number | The day's total, unrealized plus realized. |
| Total Delta | Number | Combined delta across all open positions. |
| Total Gamma | Number | Combined gamma across all open positions. |
| Total Theta | Number | Combined theta across all open positions. |
| Total Vega | Number | Combined vega across all open positions. |
| Total Premium | Number | Entry premium summed across all open positions. |
| Last Entry Underlying Price | Number | The underlying's price at your most recent entry. |
| Last Entry Time | Time | When your most recent position opened. |
| SPX Move from Last Entry | Number | How far the underlying has moved, in dollars, since your most recent entry. |
Strategy conditions can also use your own variables and shared global ones — see strategy variables.
Functions
In the advanced editor you can wrap any value in a function: abs (absolute value), min and max (the smaller or larger of two or more values), and round.
The other half — the action
Conditions decide when; the action decides what. Because the available actions differ by where the rule lives, they're covered in the surface-specific articles: template rules, strategy rules, and a position's rules.
Warning
A rule acts on its own — that's the point. When its conditions are met, it runs its action without asking. If that action opens or closes a trade and you're in LIVE mode, it moves real money. Read a rule's conditions carefully before you rely on it, and see Paper vs live.