Exit Rule: A Clear Definition
How Do You Define a Clear and Mechanical Exit Rule?
Your exit rule is where most traders fail. They're disciplined on entries but vague on exits, telling themselves they'll "see how it looks" or "hold for the bigger move." That flexibility is fatal in backtesting because it lets you cherry-pick the exits that look good in hindsight. A clear exit condition is as important as a clear entry—more important, in fact, because your exit determines how much you make or lose on each trade. This article teaches you how to write exits that are mechanical, testable, and free of discretion.
Quick definition: An exit condition is an objective, predetermined trigger—based on profit, loss, time, price action, or an indicator—that tells you the exact moment to close a position.
Key takeaways
- Exit rules must be predetermined; no changing them after you see how the trade moves.
- The four main exit types are profit targets, stop losses, time-based exits, and indicator-based exits.
- Trailing stops let you lock in gains while giving the trade room to run.
- Never use future data in an exit rule; if you can't know the exit condition exists until later, the rule has lookahead bias.
- The combination of entry, profit target, and stop loss defines your risk and reward on every trade.
The Profit Target Exit
A profit target is the simplest exit: you close the trade when the price reaches your profit goal.
Fixed-point profit target: "If the position is up 2%, sell the entire position at the market."
Fixed-dollar profit target: "If the position is up $500, sell the entire position."
Percentage-of-risk target: "If the position is up 2 times the amount risked, exit." (If you risk $500 with a stop loss, you target a $1,000 gain.)
The profit target exit has one great advantage: it's unambiguous. When the price reaches the target, you exit. No debate, no emotion, no "holding for more." The trader who uses a 2% target exits at 2%, not at 1.9% or 2.5%.
The downside is mechanical and fatal: if a stock is up 2% and you sell, you're out when the real move begins. Profit targets can be too tight. Many traders lose money long-term because their targets are too small and their stops are too large. The wins are small and the losses are large.
The Stop Loss Exit
A stop loss is the opposite of a profit target: you exit when the trade moves against you by a set amount.
Fixed-percentage stop: "If the position is down 1% from entry, sell the entire position."
Fixed-dollar stop: "If the position is down $500, sell the entire position."
Price-level stop: "If the price falls below the previous day's low, exit immediately."
ATR-based stop: "If the price moves 2 ATR (Average True Range) below the entry price, exit."
Stop losses protect capital. They force you out of trades that go wrong, which prevents catastrophic losses. The catch is the same as with profit targets: how tight should the stop be? A 1% stop will get you out of a lot of noise. A 5% stop might let a small loss become a big loss.
Trailing Stop Exits
A trailing stop is a stop loss that moves up (for longs) as the price rises. It locks in gains while giving the trade room to run.
Fixed-distance trailing stop: "Place a stop loss 1% below the highest price since entry. As the price rises, the stop rises too. If the price falls 1% from its high, exit."
ATR trailing stop: "Place a stop loss 2 ATR below the highest close since entry. As the price rises, recalculate the stop. If the price falls 2 ATR from its high close, exit."
Percentage trailing stop: "Place a stop loss 3% below the highest price since entry."
Trailing stops are elegant because they let winners run while protecting gains. If you enter at $100 and the stock rises to $110, your 1% trailing stop rises to $109. If it rises to $115, the stop is at $114. You only exit if it falls back. This lets you capture big moves without predicting how big they'll be.
Time-Based Exits
A time-based exit closes the position after a fixed period, regardless of the price.
Bar count: "Exit after 5 trading days if the position is still open."
Calendar date: "Exit on Friday's close, or if the profit target is hit first."
Intraday time: "Exit at 3:50 PM ET, 10 minutes before market close."
Earnings exit: "Exit the day before the earnings announcement."
Time-based exits work when you believe your edge is short-term. A trader who thinks prices mean-revert over 5 days will exit after 5 days. A trader who scalps intraday will exit minutes before the close. Time-based exits are useful for day traders and swing traders, but less useful for position traders who hold for weeks.
Indicator-Based Exits
An indicator-based exit closes the position when an indicator reaches a threshold or crosses a level.
Moving average exit: "Exit when the price closes below the 20-day moving average."
Momentum exit: "Exit when the RSI exceeds 70 (overbought)."
Trend exit: "Exit when the MACD histogram turns negative."
Support/resistance exit: "Exit if the price falls back below the 20-day high (breaks the uptrend)."
Indicator exits can work well because they respond to changing conditions. As long as RSI is below 70, you hold the trade. Once it exceeds 70, you're out. This is more flexible than a fixed profit target and sometimes captures larger moves.
Decision tree
Combination Exits: The Most Realistic
The most robust exit strategy combines profit target, stop loss, and time exit. This is how real traders trade.
Example: "Exit when ANY of the following occurs:
- The price rises 2% (profit target).
- The price falls 1% (stop loss).
- The position has been open for 10 days (time exit).
- The close falls below the 20-day MA (trend break)."
This exit gives the trade multiple ways to close. If it profits quickly, you take the 2%. If it turns against you immediately, you lose 1%. If it drifts for 10 days with no direction, you're out. If the trend breaks, you're out. This resembles actual trading.
Partial Exits and Scaling Out
Many traders don't exit all at once. They scale out: sell some at the profit target, hold some and trail a stop.
Scale out exit: "Sell 50% of the position when it's up 2%. For the remaining 50%, place a trailing stop 2% below the highest price."
Progressive exit: "Sell 25% at a 2% profit, 25% at 4%, 25% at 6%, and let 25% ride with a 3% trailing stop."
Scaling out is realistic and can improve results: you lock in partial gains while letting a runner potentially become a big winner. But it's also more complex to test. For your first backtests, use all-or-nothing exits. Once you understand the basics, experiment with scaling.
Order Type Exits
In live trading, you execute exits as orders: market orders, limit orders, or stop orders.
Market order exit: "Sell at the market price." Immediate, but you might not get the exact price.
Limit order exit: "Sell only if you can get at least $95.50." You might not get filled.
Stop order exit: "Sell if the price falls to $94.50." Protects you from further loss but might fill at a worse price than expected.
In backtesting, decide whether you fill at the exact price (optimistic) or at the next bar's open (conservative). For realistic testing, assume you fill at the next bar's open after the exit condition is met.
Testing Your Exit Rule for Lookahead Bias
This is the most common place for lookahead bias to hide. Check:
Test 1: Do you use tomorrow's price to decide today's exit? If your rule says "exit if the price is still above the 50-day MA at the close," you need to know today's close. If your rule says "exit if the low for the week is above $50," you need to know the whole week before exiting—that's lookahead.
Test 2: Do you use an exit signal that wouldn't be clear until later? Example: "Exit if the price is within 1% of the high of the next 5 days." You don't know the high of the next 5 days when you're deciding to exit today. That's lookahead bias.
Test 3: Can you manually walk through a trade without guessing? Pick a random entry date. Walk forward bar by bar. When does the exit trigger? If you can't answer without looking ahead, the rule has lookahead bias.
Real-World Exit Examples
Example 1: Breakout Trade Exit
"Entry: Buy if the close is above the 20-day high. Exit: Sell if the close falls back below the 20-day low (trend break), or if the position is up 3%, or after 20 days, whichever comes first."
This exit handles three scenarios: the breakout fails, the breakout succeeds and you book gains, or the trade drifts. It's specific and testable.
Example 2: Mean Reversion Exit
"Entry: Buy if the RSI is below 30. Exit: Sell when the RSI rises above 60 (trend has recovered), or after 10 days, whichever comes first."
This exit lets the reversal play out until momentum recovers, then exits. The 10-day limit prevents you from holding indefinitely.
Example 3: Trend Following Exit
"Entry: Buy if the price is above the 50-day MA. Exit: Sell if the price falls 2 ATR from the highest close since entry (trailing stop)."
This exit lets winners run while protecting profits. It's ideal for traders who hold positions for weeks or months.
Common Exit Rule Mistakes
Mistake 1: Exits that are too tight. A 1% profit target and a 0.5% stop loss means you need to win on 2 out of 3 trades just to break even. That's hard. Wider exits can be better even if they win less often.
Mistake 2: Inconsistent exits. Using a 2% stop loss on some trades and 5% on others means you're not testing a system; you're testing your mood. Pick one stop loss and stick with it.
Mistake 3: Exits with lookahead bias. "Exit if the price is the highest it will be for the next 10 bars." You can't know that when exiting. The exit is rigged.
Mistake 4: Exits that trap you. "Exit if the price is above the 50-day MA" in a falling trend means you're exiting when the price bounces up into the MA, then falling again. You exit, prices fall, you wanted to be short. Avoid exits that are sensitive to noise.
Mistake 5: No exit limit. "Exit when I feel like it" or "when the situation changes" is not a rule. It's discretion. Discretion in backtesting produces fantasy results.
FAQ
Should my stop loss or profit target come first?
It doesn't matter. In a backtest, the first condition to be met is the exit. If the price drops 1% (stop loss) before rising 2% (profit target), the stop loss wins and you exit down. If it rises 2% before dropping 1%, you exit up. Both are valid.
What if my exit never triggers and the position drifts indefinitely?
That shouldn't happen if you have a time-based exit. Every position should have a maximum holding period: "if it's not profitable after N days, exit." This prevents zombie trades.
Can I move my stop loss after the trade starts?
Not in a backtest. Or rather, you can, but you need to define the rule first. Example: "Move the stop loss up to breakeven after the trade is up 2%." That's a valid rule. But moving the stop loss down is disaster—it removes the discipline of the trade.
Should I use different exits for different types of trades?
You can, but each type needs its own written rule. "For breakout trades, use a trailing 2% stop. For mean reversion trades, use a time exit after 5 days." Write both down before the backtest.
How do I know if my exit is too tight or too loose?
Backtest the same entry with multiple exits and compare results. Test 1% and 2% and 3% stops. Test 2% and 5% and 10% profit targets. The results will show you. The exit that works depends on the market and the entry. There's no universal answer.
Can I exit based on news or events?
You can, but be careful about lookahead bias. If you want to exit on earnings, define it as "the bar on which earnings are announced." You know when earnings are announced beforehand, so that's not lookahead. But "exit if earnings are bad"—you don't know that until after.
Related concepts
- Defining Rules Before Backtesting — The framework that includes exit rules.
- Stop Loss Rule in a Backtest — Deep dive into stop loss mechanics and psychology.
- Entry Rule: A Clear Definition — How entry and exit work together.
- Position Sizing in a Backtest — How position size changes exit impact.
Summary
An exit rule is a predetermined trigger that tells you when to close a position. The most common exits are profit targets (fixed percentage or dollar), stop losses (protect against large losses), trailing stops (lock in gains), time-based exits (hold for N days), and indicator-based exits (respond to changing conditions). The best exit combines multiple conditions: profit target OR stop loss OR time limit OR indicator signal. Write your exit in plain language first, then verify it has no lookahead bias. Never exit based on "feeling" or "looking ahead." Never use information that won't be available until after the bar closes. The traders who profit consistently are not the ones with the best entries; they're the ones with mechanical, predetermined exits that they actually follow. Your exit is where discipline lives.