Skip to main content

What Is a Trailing Stop Loss in Trading (and How to Use It Automatically)

July 2, 2026 · 6 min read

A trailing stop loss in trading is a dynamic exit order that moves with the price as your position gains value — locking in profits along the way — but stays put if the price reverses. When the price drops far enough from its peak, the stop triggers and the position closes automatically.

It's one of the most powerful risk management tools available to retail traders, and one of the most underused. Here's exactly how it works, when to use it, and how platforms like Quant-Builder.ai automate it so you don't have to watch the market to manage your exits.

How a Trailing Stop Loss Works

A standard stop loss is fixed — you set it at a specific price and it stays there. A trailing stop loss moves upward (for long positions) as the price rises, maintaining a set distance below the highest price reached.

Example: You buy a stock at $100 and set a 5% trailing stop. Your stop starts at $95. The stock rises to $120 — your stop moves up to $114. The stock then drops from $120 to $114 — the stop triggers, you exit at $114. You locked in a 14% gain instead of giving it all back.

If the stock had simply dropped from $100 to $95 without ever rising, the stop would have triggered at $95 — limiting your loss to 5%.

The trailing stop only moves in the direction of the trade. For a long position, it moves up with rising prices. It never moves back down.

Trailing Stop vs. Fixed Stop Loss

  • Fixed stop loss: Set at a specific price. Doesn't move. Good for defining your maximum loss on entry, but won't protect profits if the trade runs in your favor.
  • Trailing stop loss: Moves with price. Automatically locks in gains as the position grows. Requires no manual adjustment. Better for swing trades where you want to let winners run while limiting drawdown.

For most swing trading strategies, a trailing stop is superior to a fixed stop because it adapts to how the trade develops. A fixed stop at -5% from entry can turn a 15% winner into a breakeven trade if you forget to adjust it.

How to Size a Trailing Stop

The distance you set for your trailing stop determines how much room you give the trade to breathe before exiting.

  • Too tight (1–2%): You'll get stopped out on normal daily volatility. The trade never has a chance to develop.
  • Too wide (20%+): You give back too much profit before the stop triggers. Acceptable loss is too large.
  • ATR-based (recommended): Set the trailing stop as a multiple of ATR (Average True Range) — a volatility measure that adjusts for how much a stock typically moves. A 1.5× ATR trailing stop gives the position room proportional to its normal volatility.

ATR-based trailing stops are what professional systematic traders use. A stock with a daily ATR of $3 needs a different stop distance than a stock with a daily ATR of $0.30 — a percentage-based stop treats them identically, which is wrong.

The Problem With Manual Trailing Stops

In theory, managing trailing stops manually is straightforward. In practice, it means watching the market constantly, adjusting stops as prices move, and making decisions under pressure — exactly the conditions that lead to emotional errors.

Most traders either:

  • Set a fixed stop and never adjust it (missing the trailing benefit), or
  • Try to manage it manually and move the stop too early when they get nervous, or
  • Forget to adjust it at all because they're at work or asleep

The solution is automation.

How Quant-Builder Automates Trailing Stops

When you execute a trade through Quant-Builder, you choose your stop loss type at order time — fixed percentage or ATR-based trailing stop. The platform submits the trailing stop order to Alpaca automatically when your entry fills.

From that point, Alpaca manages the trailing stop in real time. As the stock rises, the stop adjusts upward automatically. You don't need to watch it. You don't need to log in and move anything. The stop is live and updating whether your computer is on or not.

If you choose ATR-based trailing stops, Quant-Builder recalculates the ATR each morning using the previous night's data and updates the stop level accordingly — so your stop is always calibrated to current volatility, not the volatility that existed when you entered the trade.

Trailing Stop + Automatic Exit Date

Quant-Builder's systematic strategies also include a target close date for each pick — the number of days the model predicts the trade should be held. If the trailing stop hasn't triggered by the target close date, the platform automatically submits a Market-on-Close exit order at 3:50 PM ET on that date.

This means every trade has two exit conditions working simultaneously:

  • The trailing stop — exits early if the stock reverses significantly
  • The target close date — exits on schedule if the stop is never hit

You set both at entry. The system manages both automatically. You never have to manually close a position.

Start Using Automated Trailing Stops

The free demo at quant-builder.ai/learn lets you build a model, see picks, and experience the full execution workflow — including stop loss configuration — before spending anything.

Plans start at $25/month. Automated trailing stops, ATR recalculation, and automatic target-date exits are included on all paid plans.

BUILD YOUR FIRST MODEL

Train a machine learning stock picking model in minutes — no code required. Walk-forward backtesting runs automatically.