Automated Stop Loss and Exit Management

How Trade Manager monitors open positions, trails Stop Losses, and executes exits automatically using candle-confirmed logic.

Trade Manager (TM) monitors every open position, trails your Stop Loss (SL), and fires exit orders when conditions confirm. This page covers TM's execution model, the trade lifecycle, SL trailing methods, and the tradeoffs you should understand.

Execution model: candle-confirmed, not tick-based

TM does not react to every price tick. It waits for a candle to close before making exit decisions. This is a deliberate tradeoff.

Why candle-confirmed: Tick-based exits trigger on intraday noise. A wick that touches your SL and reverses would stop you out. Candle-confirmed exits filter that noise — the price must hold below your SL through the entire candle duration before TM acts.

The tradeoff: During gaps, realized loss can exceed your SL level. Example: you hold a long position in AAPL with SL at $95. Overnight news drops the stock. The next candle opens and closes at $93. TM confirms the breach and exits at approximately $93 — not $95. The $2 gap between your SL and actual exit is the cost of noise filtering. This is not a bug. It is the explicit tradeoff between avoiding false exits and accepting gap risk.

⚠️

Candle-confirmed exits mean your actual exit price can differ from your SL during gaps. Size your positions with this in mind.

Trade lifecycle

Every trade moves through a defined state machine:

ACTIVE → BREAKEVEN → TRAILING → PENDING_EXIT → CLOSED

ACTIVE

The trade is open and SL sits below entry (for longs) or above entry (for shorts). TM applies Candle-by-Candle (CbC) and R-multiple trailing to tighten the SL toward entry. This is the initial protection phase — your SL is improving but has not yet reached breakeven.

BREAKEVEN

SL has reached your entry price. From here, you cannot lose money on the trade (excluding gap risk). TM switches to a wider trailing candle timeframe — typically a higher timeframe that gives the position more room to run. Entry price becomes the floor: the SL will never move below entry again.

TRAILING

SL is now above entry (longs) or below entry (shorts). Every candle that extends in your favor ratchets the SL higher (or lower for shorts). The position is in profit-protection mode. TM continues applying CbC and R-trail methods, locking in gains as the move extends.

PENDING_EXIT

Price has breached the SL and a candle has confirmed the breach. TM fires an exit order to the execution engine for order placement. The trade stays in this state until the exit order fills.

CLOSED

The position is flat. Exit price, exit reason, and full audit trail are recorded.

There are two additional states for edge cases: RETRY_EXIT (exit order was rejected or partially filled — TM retries), and UNTRACKED (position exists at the broker but has no matching trade record).

SL trailing methods

TM uses two independent methods to trail SL. When both are active, they compete — and the more protective value wins.

CbC: Candle-by-Candle trailing

CbC moves your SL based on completed candles. For a long position:

  1. Each completed candle that matches the direction filter (green candle for longs) is evaluated
  2. If the candle's low is higher than current SL, SL moves up to the candle's low
  3. When the candle's low reaches entry price, the trade transitions to BREAKEVEN

After breakeven, TM switches to a second candle timeframe (often a larger one) and continues trailing. The larger timeframe gives the position more room to breathe while still ratcheting SL upward.

Jurisdiction rule: When the pre-breakeven and post-breakeven candle timeframes differ, each owns its territory. The smaller timeframe moves SL up to entry. The larger timeframe moves SL beyond entry. Neither crosses the other's boundary.

R-Trail: R-multiple milestone moves

R-Trail moves SL to predetermined levels based on profit milestones. The milestones are defined in R-multiples — where 1R equals your initial risk (the distance between entry and initial SL).

For a long position with entry at $185 and initial SL at $180 (1R = $5):

Price reachesMilestoneSL moves to
$190+1R$185 (breakeven)
$195+2R$190 (+1R)
$200+3R$195 (+2R)

Configuration determines how far R-Trail extends. Settings range from moving SL to breakeven at +1R and stopping, all the way to continuing indefinitely at every subsequent R-level.

For short positions, the math inverts: entry at $185, SL at $190, price drops to $180 = +1R, SL moves down to $185.

Golden Rule: most protective wins

When both CbC and R-Trail produce an SL value, TM picks the more protective one. For longs, the higher SL wins. For shorts, the lower SL wins.

Example: CbC calculates SL at $188 based on candle lows. R-Trail calculates SL at $190 based on the +2R milestone. TM uses $190 because it protects more profit.

Silver Rule: SL never moves backward

Once SL moves in the favorable direction, it never reverses. For longs, SL only increases. For shorts, SL only decreases. This is enforced at every calculation cycle, regardless of what CbC or R-Trail compute.

Virtual close

Five minutes before market close, TM triggers a virtual close. All open candle timeframes are treated as completed, and normal exit logic runs against them. This prevents positions from being held overnight on a technicality — a 75-minute candle that hasn't formally closed does not block an exit decision at end of day.

Signal conflicts

If two strategies fire opposite signals on the same instrument — say strategy A is long AAPL and strategy B fires a short signal on AAPL — both positions coexist independently. TM manages each trade according to its own strategy rules. It does not net positions or cancel opposing trades. Each trade has its own SL, its own trailing logic, and its own exit conditions.

What you control vs. what is automatic

You configureTM handles automatically
Strategy rules (candle timeframes, R-trail depth, color filter)SL calculation every candle cycle
Initial SL level (set at entry)State transitions (ACTIVE → BREAKEVEN → TRAILING)
Which strategies run on which accountsGolden Rule and Silver Rule application
Exit order dispatch when SL is breached and confirmed
Virtual close logic
Retry on failed exit orders

Strategy rules are frozen into the trade record at entry time. Changing rules in your config affects new trades only — active trades continue under their original rules.

💡

Every SL change, state transition, and exit decision is logged to Telegram in real time. Review your trade's audit trail at any point.

Strategy-level exits: Kill Switch

On each decision cycle, TM also evaluates Kill Switch thresholds — if aggregate strategy P&L has crossed a configured limit, TM exits all open trades in that strategy before evaluating individual trade SL logic.

Kill Switch complements per-trade SL trailing: TM manages individual exits based on candle confirmation, Kill Switch manages strategy-level exits based on aggregate P&L. Both run automatically on the same cycle.


This is engineering infrastructure, not investment advice. All trading involves risk of loss.

Next steps

  • See Position Sizing and Risk for how lot count is determined before entry.
  • See Order Intelligence for what happens after TM dispatches an exit order.
  • Need custom automation beyond built-in strategies? Talk to us.