Skip to main content

What exit logic is

Exit logic defines when and how a trade is closed. A trade is considered complete only when an exit condition is met. Without exit logic, a strategy cannot be executed or backtested.
Every direction (long and short) must have a valid exit.

Types of exit logic

Exit logic can be based on different mechanisms.

Fixed exits

Take profit and stop loss defined as fixed percentages or values.

Indicator-based exits

Exits triggered by indicator conditions.

Time-based exits

Trades close after a defined duration.

Conditional exits

Exits that depend on market context or regime.

Fixed exits (TP / SL)

The most common exit type. Example:
Exit with a 5% take profit and a 1% stop loss.
Fixed exits are:
  • easy to reason about
  • deterministic
  • comparable across strategies
They apply symmetrically to long and short trades unless specified otherwise.

Indicator-based exits

Indicator exits close a trade when a condition becomes true. Examples:
Exit long when RSI(14) crosses below 50.
Exit short when EMA(20) crosses above EMA(50).
Indicator exits:
  • adapt to market behavior
  • can shorten or extend trades
  • are evaluated on candle close

Time-based exits

Time-based exits close a trade after a certain duration. Example:
Exit any trade after 12 hours.
These exits:
  • cap exposure time
  • prevent very long trades
  • are often combined with TP/SL

Multiple exit conditions

A trade may have multiple exit conditions. Example:
Exit with a 6% take profit,
or a 1.5% stop loss,
or after 24 hours.
The first exit condition met closes the trade.

Direction-specific exits

Exit logic may differ by direction. Example:
For long trades use a 6% TP and 1% SL.
For short trades use a 4% TP and 1.5% SL.
This allows:
  • asymmetric risk profiles
  • adaptation to market behavior

When exits are evaluated

Exit logic is evaluated:
  • on every candle close
  • while a trade is open
  • before new entries are considered
Exit conditions always take priority over new entries.

Default behavior

If exit logic is:
  • missing → strategy is invalid
  • partially defined → ATI requests clarification
  • clearly implied → ATI may infer conservatively

What Trinigence fills automatically

See how missing exit details are handled.

Common mistakes

Strategies without stop loss usually produce misleading results.
Multiple exits may interact in unexpected ways.
Exits are evaluated on candle close by default.

Best practices

  • Always define both TP and SL
  • Inspect exit timing visually
  • Use time-based exits for safety
  • Keep exits simpler than entries

Risk management

Learn how exits and risk work together.

Entries decide if you trade.
Exits decide how you perform.