Trade Lifecycle: Entry to Exit

Every trade moves through a defined sequence of states from entry signal to close. Here is what each state means and what triggers transitions between them.

Every trade moves through a defined sequence of states from entry signal to close. Understanding these states helps you read Dash, interpret Telegram alerts, and know exactly where your trade stands at any moment.

The defined sequence of stages (state machine)

A trade progresses through these states:

Entry Signal → Order Placed → Order Filled → ACTIVE → BREAKEVEN → TRAILING → PENDING_EXIT → CLOSED

Each state represents a distinct phase of trade management. The system transitions between states automatically based on price action and your strategy rules.

ACTIVE

The trade is open and the Stop Loss (SL) sits below entry for longs or above entry for shorts. This is the initial protection phase.

What happens here: Trade Manager (TM) monitors price against your SL. If Candle-by-Candle (CbC) trailing is enabled, SL tightens toward entry as favorable candles complete. If R-trail is enabled, crossing the +1R profit threshold moves SL to breakeven.

What triggers the next transition: SL reaches entry price. For a long, the candle low rises above your entry. For a short, the candle high drops below your entry.

Typical duration: Minutes to days, depending on how quickly price moves in your favor.

In Dash: The trade card shows state ACTIVE with current SL distance from entry.

BREAKEVEN

SL has reached entry price. The trade is now risk-free — if stopped out, you lose nothing (excluding fees and slippage).

What happens here: TM switches from the initial trailing timeframe to the post-breakeven trailing timeframe (often a larger timeframe). Trailing continues but entry price becomes the floor — SL never moves back below entry for longs or above entry for shorts.

What triggers the next transition: SL moves beyond entry. For a long, SL rises above the entry price. For a short, SL drops below entry.

Typical duration: Brief — often a single candle cycle on the post-breakeven trailing timeframe.

In Dash: State shows BREAKEVEN. Telegram sends a breakeven alert.

TRAILING

SL is above entry for longs or below entry for shorts. Every SL move now locks in more profit.

What happens here: Both CbC and R-trail methods continue calculating SL levels. The Golden Rule picks the more protective value. The Silver Rule prevents SL from ever moving backward. Your profit floor rises with every favorable candle.

What triggers the next transition: Price reverses and breaches the trailing SL. The system waits for the configured candle timeframe to confirm the breach before exiting — no intraday panic exits.

Typical duration: Hours to days. This is where most profit accumulates.

In Dash: State shows TRAILING with the current SL and locked profit amount.

See Trailing Stop Loss Methods for how CbC and R-trail work together.

PENDING_EXIT

Price has breached SL and the candle confirmation condition is met. TM has dispatched an exit order to the execution engine.

What happens here: The execution engine places a MARKET order through your broker. The reconciliation system monitors fill status — complete fills, partial fills (retried automatically), or rejections.

What triggers the next transition: Order fills completely, or all retry attempts resolve.

Typical duration: Seconds to minutes. Most exits fill within seconds during liquid market hours.

In Dash: State shows PENDING_EXIT. Telegram sends an exit alert with the exit reason (e.g., SL_HIT_15m, TRAILING_75m, VIRTUAL_CLOSE_D).

CLOSED

The trade is fully exited. Final P&L and R-multiple are calculated and recorded.

What happens here: Nothing — the trade is complete. Track computes analytics: R-multiple, hold duration, strategy performance contribution.

In Dash: Trade moves to the closed trades list with full metrics.

Special states

RETRY_EXIT

The exit order failed — broker rejected it, or a network error occurred. TM retries the exit automatically.

What happens here: The system re-dispatches the exit order. If the position still exists at the broker but the order keeps failing, RETRY_EXIT persists until resolved.

When you see this: Check your broker connection. A stale API token is the most common cause. Dash shows RETRY_EXIT with the failure reason.

⚠️

RETRY_EXIT means the system is trying to close your position but encountering errors. If this persists for more than a few minutes, verify your broker credentials in AccountConfig.

UNTRACKED

A position exists at the broker that the system did not open and is not managing.

What happens here: Nothing — the system ignores UNTRACKED positions. No SL management, no trailing, no exit logic.

Common causes: You placed a manual trade through your broker's app, or a previous system error left an orphaned position.

Resolution: Either close the position manually through your broker, or register it with the system if you want automated management.

Exit reasons

When a trade closes, the exit reason tells you exactly what triggered it:

Exit Reason PatternMeaning
SL_HIT_{timeframe}Initial SL breached, confirmed on that candle timeframe
FLOOR_HIT_{timeframe}Breakeven floor breached after reaching BE
TRAILING_{timeframe}Trailing SL breached in profit territory
VIRTUAL_CLOSE_{timeframe}Exit triggered at virtual close (5 min before market close)
RETRY_EXIT_SL_BREACHEDExit after retry — SL was breached during the retry period

Where to monitor

  • Dash — real-time state, current SL, P&L, R-multiple for every open trade
  • Telegram alerts — state transitions (breakeven reached, exit triggered) with trade details
  • Track — post-close analytics, strategy performance, equity curves

Next steps

  • Trailing Stop Loss Methods — how CbC and R-trail protect your profits
  • R-Multiples — the risk metric used to measure every trade

See these concepts in action: Execute overview.

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