Appearance
Personalize your experience
Step 6 — Exit & Risk
Wizard stepExit conditions, stop loss, take profit, staged partial exits and portfolio-level limits. The step that decides whether a losing trade costs you a percent or an account.
The one non-negotiable
Three mechanisms can close a position, and they operate independently: the exit , the , and the take profit. Whichever comes first wins. That independence is deliberate — it means a stop still works when your exit condition has a bug in it.
Three ways to configure exits
Just like entry conditions, exits can be configured through the -and-drop , the node graph, or the DSL code editor. All three modes present the same fields — exit conditions, , take profit, and partial exits — in different . Changes sync in real time across all three .
┌──────────────────────────────────────────────────────────────────────────────┐
│ EXIT CONFIGURATION IN THREE MODES │
├──────────────────────────────────────────────────────────────────────────────┤
│ │
│ DRAG-DROP FORM NODE GRAPH CODE DSL │
│ ┌──────────────┐ ┌──────────────┐ exit { │
│ │ Exit Cond │ │ ◉ RSI(14) │ condition: │
│ │ RSI < 70 │ │ ↓ │ RSI(14)<70 │
│ └──────────────┘ │ ◈ < 70 │ stopLoss: { │
│ │ ↓ │ type: "atr" │
│ ┌──────────────┐ │ ◆ EXIT │ value: 2.5 │
│ │ Stop Loss │ └──────────────┘ } │
│ │ Type: ATR │ takeProfit: { │
│ │ Value: 2.5 │ ┌──────────────┐ type: "rr" │
│ └──────────────┘ │ ⚠ STOP │ ratio: 3 │
│ │ ATR × 2.5 │ } │
│ ┌──────────────┐ └──────────────┘ partials: [ │
│ │ Take Profit │ {pct: 40, │
│ │ Type: R:R │ ┌──────────────┐ tgt: 2%} │
│ │ Ratio: 3 │ │ ✓ TARGET │ {pct: 30, │
│ └──────────────┘ │ R:R = 3 │ tgt: 4%} │
│ └──────────────┘ ] │
│ ┌──────────────┐ } │
│ │ Partials │ All three feed: │
│ │ 40% @ +2% │ ┌──────────────┐ │
│ │ 30% @ +4% │ │ ◆ OR GATE │ │
│ │ 30% @ +6% │ │ ↓ │ │
│ └──────────────┘ │ ⬛ CLOSE │ │
│ └──────────────┘ │
└──────────────────────────────────────────────────────────────────────────────┘
Same exit logic — condition, stop, target, partials — expressed three ways.
Switch modes anytime: changes sync instantly, no data lost.Exit conditions
Exit conditions use the same structure as entries — left, operator, , joined by AND and OR. When the tree resolves true, a closing order goes out. The side is set automatically to the opposite of the entry.
| Field | Type | Description |
|---|---|---|
| conditions | ConditionGroup | The exit tree. Identical structure to entry conditions. SMA(50) crossesBelow SMA(200) is a typical trend-reversal exit. |
| order | OrderConfig | and time-in-force for the exit. Side is derived: sell to close a long, buy to close a short. |
Stop loss
The stop caps the loss on a single trade. It is the most field in the , and the three calculation modes differ in one respect that matters: whether the distance adapts to market conditions.
| Field | Type | Default | Description |
|---|---|---|---|
| stopLoss.enabled | boolean | false | On or off. Should be on. |
| stopLoss.type* | "percentage" | "fixed" | "atr" | — | How the distance from entry is derived. |
| stopLoss.value* | number | — | : percent below entry, 2 meaning 2%. : absolute price units. : the multiplier, 2 meaning 2 × ATR(14). |
| stopLoss.trailing | boolean | false | The stop follows favourable movement, locking in gains. It never moves backwards. |
| stopLoss.trailingAmount | number | — | How far behind the peak favourable price the trailing stop sits. |
| stopLoss.trailingType | "percentage" | "fixed" | "percentage" | Whether the trailing distance is a percent of the peak or an absolute amount. |
PERCENTAGE STOP ATR STOP
entry 100, stop 2% entry 100, stop 2 × ATR(14)
ATR = 3.50 → stop distance 7.00
price ▲ price ▲
105 │ 105 │
100 │ ── ENTRY 100 │ ── ENTRY
│ │
98 │ ── STOP max loss 2.00 93 │ ── STOP max loss 7.00
│ same distance in every regime │ widens when volatility does
TRAILING STOP (2% trail)
price ▲
115 │ ── peak
113 │ ── stop now here (2% below the peak)
110 │ ── stop was here (when price was 112)
108 │ ── stop was here (when price was 110)
100 │ ── ENTRY
98 │ ── initial stop (2% below entry)
the stop ratchets up as price rises and never moves back down;
the exit triggers when price falls to wherever the stop has reachedConfiguring stops in drag-and-drop mode
- Navigate to the Exit & Risk step
- Check "Enable "
- Select stop type from dropdown: , Price, or -based
- Enter the stop — 2 for 2%, or 2.5 for 2.5×
- Optional: enable trailing stop checkbox
- Set trailing amount — how far the stop trails behind the peak price
- Preview: the chart shows where the stop would have triggered on historical
- Run a backtest to see stop-loss in the
Configuring stops in node graph
In the node builder, the appears as a dedicated risk node that feeds into the exit OR gate alongside condition and target nodes. This makes the visually: whichever mechanism fires first closes the position.
- Add a "" node from the risk management palette
- Click the node to configure: type (//) and
- Enable trailing if desired — a sub-node appears with trailing parameters
- Connect the stop node output to the exit OR gate input
- The OR gate now has three inputs: exit condition, , take profit
- Run the graph to validate — the execution log shows which mechanism fired per trade
Configuring stops in code DSL
# Percentage stop — simplest
stopLoss: {
enabled: true
type: "percentage"
value: 2.0 # 2% below entry
trailing: false
}
# ATR-based stop — adapts to volatility
stopLoss: {
enabled: true
type: "atr"
value: 2.5 # 2.5× ATR(14)
trailing: false
}
# Trailing stop — follows price up, locks gains
stopLoss: {
enabled: true
type: "percentage"
value: 2.0 # initial stop
trailing: true
trailingAmount: 2.0 # trails 2% below peak
trailingType: "percentage"
}Take profit
Take profit closes the position at a favourable target. Same three- as the stop, with risk-reward as the third option instead of .
| Field | Type | Default | Description |
|---|---|---|---|
| takeProfit.enabled | boolean | false | When price reaches the target, the full remaining position closes. |
| takeProfit.type* | "percentage" | "fixed" | "riskReward" | — | above entry, an absolute distance, or a multiple of the . |
| takeProfit.value* | number | — | : 4 meaning 4%. : absolute units. Risk-reward: 2 meaning the target sits twice the away. |
Partial exits
Partial exits take profit in stages rather than all at one target: bank some of the position early, let the rest run. It is the standard answer to the tension between not giving profits back and not capping a good trade.
PARTIAL EXIT LADDER — EXECUTION FLOW
──────────────────────────────────────────────────────────────
Entry: 100 shares @ $100
Price rises to $102 → Level 1 triggers
├─ Sell 40 shares @ $102 40 × $2 = +$80 banked
└─ Remaining: 60 shares
Price rises to $104 → Level 2 triggers
├─ Sell 30 shares @ $104 30 × $4 = +$120 banked
└─ Remaining: 30 shares
Price rises to $106 → Level 3 triggers
├─ Sell 30 shares @ $106 30 × $6 = +$180 banked
└─ Remaining: 0 shares
└─ Total profit: +$380
──────────────────────────────────────────────────────────────
Alternative: reverses at $103 after Level 1
Price rises to $102 → Level 1 triggers
├─ Sell 40 shares @ $102 40 × $2 = +$80 banked
└─ Remaining: 60 shares
Price reverses to $98 → Stop triggers
├─ Sell 60 shares @ $98 60 × −$2 = −$120 loss
└─ Net P&L: +$80 − $120 = −$40
Without partials: 100 shares × −$2 = −$200
With partials: net −$40
→ partials cut the loss by 80%
──────────────────────────────────────────────────────────────
CONFIGURATION IN DRAG-DROP:
┌─────────────────────────────────────┐
│ Partial Exit Levels │
├─────────────────────────────────────┤
│ Level 1: 40% @ +2.0% target │
│ Level 2: 30% @ +4.0% target │
│ Level 3: 30% @ +6.0% target │
│ ──────────────────────────────── │
│ Total: 100% │
│ │
│ [+ Add Level] [Import Template] │
└─────────────────────────────────────┘
CONFIGURATION IN CODE DSL:
partialExits: [
{ percent: 40, targetType: "percent_move", targetValue: 2.0 },
{ percent: 30, targetType: "percent_move", targetValue: 4.0 },
{ percent: 30, targetType: "percent_move", targetValue: 6.0 }
]| Field | Type | Description |
|---|---|---|
| partialExits | PartialExit[] | The levels, each specifying how much of the position to close and at what target. |
| partialExit.percent* | number | Share of the total position closed at this level. Levels should sum to 100% or less; any remainder rides to the final target, stop or condition exit. |
| partialExit.targetType* | "percent_move" | "fixed_price" | "rr" | "indicator" | How the is computed: percent from entry, an exact price, a multiple of the , or a indicator level. |
| partialExit.targetValue* | number | The . For percent_move, 2 means exit at 2% profit; for rr, 1.5 means 1.5× the . |
entry 100, stop 98 (−2%), position 100 shares ┌──────────────────────────────────────────────────────────┐ │ level 3 sell 30% @ +6% (106) 30 shares │ │ level 2 sell 30% @ +4% (104) 30 shares │ │ level 1 sell 40% @ +2% (102) 40 shares │ │ ══════════ ENTRY 100 ══════════════════════════════════ │ │ stop sell all remaining @ 98 │ └──────────────────────────────────────────────────────────┘ all three levels hit 102 → 40 × 2 = +80 104 → 30 × 4 = +120 106 → 30 × 6 = +180 total +380 reverses at 103 after level 1 banked 40 × 2 = +80 stopped 60 × 2 = −120 net −40 without partial exits the same path is a flat −200
Configuring partials in drag-and-drop mode
- In the Exit step, check "Enable Partial Exits"
- Click "+ Add Level" to create the first partial exit
- Set the percent of position to exit — e.g., 40% for the first level
- Select target type: Percent Move, Risk-Reward Ratio, Price, or Indicator Level
- Enter the target — 2 for 2% profit, or 1.5 for 1.5× the
- Add additional levels with "+ Add Level" — each gets its own and target
- Verify total ≤ 100% — the builder warns if you exceed position size
- Use "Preview Ladder" to see partial exits marked on the chart alongside entry/stop
- levels up/down to reorder them if targets should fire in a different sequence
- Use : click "Load Template" for common patterns (40-30-30, 50-30-20, etc.)
Configuring partials in node graph
Partial exits in the node builder appear as a series of target nodes that feed into a staged exit coordinator. Each target node represents one level, and the coordinator ensures they fire in sequence as price moves through the targets.
- Add a "Partial Exit Coordinator" node — this manages the ladder
- Add a "Target Level" node for each partial exit you want
- Configure each target: (40%, 30%, 30%) and (2%, 4%, 6%)
- Connect each target node to the coordinator input ports
- Connect the coordinator output to the exit OR gate
- The graph shows visually how many levels you have and their order
- Run the graph: execution log shows which levels and at what price
Configuring partials in code DSL
1partialExits: [2 {3 percent: 404 targetType: "percent_move"5 targetValue: 2.0 # exit 40% at +2% profit6 },7 {8 percent: 309 targetType: "percent_move"10 targetValue: 4.0 # exit 30% at +4% profit11 },12 {13 percent: 3014 targetType: "rr"15 targetValue: 3.0 # exit 30% at 3× risk-reward16 }17]1819# Alternative: indicator-based targets20partialExits: [21 {22 percent: 5023 targetType: "indicator"24 targetValue: "BB_Upper(20,2)" # exit half at Bollinger upper band25 },26 {27 percent: 5028 targetType: "indicator"29 targetValue: "EMA(21)" # exit rest at EMA(21) hit30 }31]Portfolio risk limits
Per-trade stops bound one trade. These bound the day and the book, which is what stops a correlated run of losses from into something structural.
| Field | Type | Description |
|---|---|---|
| maxDailyLoss | number | Daily loss ceiling as a of capital. On breach the stops opening for the rest of the day. 3 means after a 3% daily loss. |
| maxOpenPositions | number | Concurrent positions allowed across strategies. A portfolio-level cap against over-. |
Exit retry
Exit orders can fail: a broker rejection, thin liquidity, a dropped . Because a failed exit leaves a position with no protection, retry behaviour is configurable rather than .
| Field | Type | Default | Description |
|---|---|---|---|
| retryMaxAttempts | number | 3 | Attempts before the alerts and pauses. |
| retryDelayBars | number | 1 | Bars to wait between attempts. |
| retryCondition | "re-evaluate" | "force-exit" | — | Re-evaluate re-checks the exit conditions and may abandon the exit if they no longer hold. Force-exit closes regardless. |
Before moving on
- Chosen a builder for exit configuration — form, nodes, or code
- A configured — this is not optional
- appropriate: roughly 1–5% for equities, 3–8% for crypto, -based preferred
- A take profit or exit condition present, ideally both
- Trailing stop considered for trend-following strategies
- Risk-reward target of at least 2:1 if using that
- Partial exit levels if staged profit-taking suits the
- Partial exit percentages sum to ≤100% — validated in the form
- maxDailyLoss set to bound a bad
- An exit condition acting as a backstop independent of the stop
- Exit behaviour checked in a backtest, reading the exit-reason column
- Retry settings configured before any
- If using DSL: exit logic exported for or version control
See also
Related articles
Related to Step 6 — Exit & Risk
- Step 5 — Entry Signals
Automation / Strategy Builder / Wizard Steps
Where the strategy is actually written. Conditions, operators, nesting, order configuration, multiple entry sets, and the re-entry engine behind Grid, DCA…
- Step 0 — Particulars
Automation / Strategy Builder / Wizard Steps
Identity and metadata: the name, description, tags and visibility that make a strategy findable a year from now. Also where the immutable Strategy ID is minted.
- Step 1 — Settings
Automation / Strategy Builder / Wizard Steps
Global behaviour that decides how entries and exits interact: whether the strategy builds a position in stages, which multi-entry model it follows, and how…
- Step 2 — Tagging
Automation / Strategy Builder / Wizard Steps
Optional. Client order ID templates, signal-level metadata and order linking — the machinery that makes live orders reconcilable against broker statements.
- Step 3 — Symbol
Automation / Strategy Builder / Wizard Steps
The trading context: broker, segment, instrument, timeframe and session mode. These choices decide what data exists, what order types are available, and…
- Step 4 — Quantity & Capital
Automation / Strategy Builder / Wizard Steps
How much to trade. Four sizing modes, the capital they draw on, the leverage applied, and how capital is divided across entry sets.
- Step 7 — Strategy Testing
Automation / Strategy Builder / Wizard Steps
The testing step offers three modes, each answering different questions about strategy behavior. Use all three in sequence: backtest to validate logic,…
- Step 8 — Review & Deploy
Automation / Strategy Builder / Wizard Steps
Review is the final step before deployment. It presents the complete strategy configuration in one place, runs validation checks, highlights errors and…
- Strategy DSL — Execution Model
Coding / Strategy DSL
What the engine does on every bar: protective exits, exit signals, entries, layers and re-entries, sizing and costs, and where every statistic in the result…