Trailing stop explained: how it follows price
By Oalgo · Last reviewed
A trailing stop is a stop that moves in the trade's favour as price moves, and never moves back. For a long trade it sits a set distance below the highest price reached since entry, so it rises when price rises and stays where it is when price falls. When price falls to it, the trade closes.
How does a trailing stop move?
#- At entry the stop is placed a set distance from the entry price. A percentage stop is entry price × (1 − trailing %). An ATR stop is entry price − multiplier × ATR.
- Each time price makes a new highest high since entry, the stop is recalculated from it: highest high × (1 − trailing %), or highest high − multiplier × ATR.
- The stop only moves up. If the new value is lower than the current stop, the stop stays.
- A short trade is the mirror: the stop sits above the lowest price since entry and only moves down.
- In a test, a candle's high moves the stop for the next candle. A candle gives its high and its low but not which came first, so one candle never moves the stop and hits it in the same step.
What does a worked example look like?
#A long trade enters at 100 with a 2% trailing stop, so the stop starts at 100 × 0.98 = 98.
| Candle | High | Low | Stop when the candle starts | Highest high so far | Stop for the next candle |
|---|---|---|---|---|---|
| 1 | 103 | 100 | 98 | 103 | 103 × 0.98 = 100.94 |
| 2 | 106 | 102 | 100.94 | 106 | 106 × 0.98 = 103.88 |
| 3 | 106 | 104.5 | 103.88 | 106 | 103.88 (no new high, stop stays) |
| 4 | 105 | 103 | 103.88 | 106 | Closed: the low, 103, is at or below 103.88 |
The trade closes on candle 4 at 103.88, which is 3.88% above the entry before fees and slippage. A fixed 2% stop would still be at 98. If candle 4 had opened at 103, below the stop, a test closes the trade at that open, 103, not at the stop price.
How do you set a trailing stop in Oalgo?
#In Oalgo the Trailing Stop block has two types, ATR-based and Percentage. A new block starts as ATR-based, with a multiplier of 2 and an ATR period of 14. The Percentage type uses a Trailing Percent that starts at 1.5. A strategy with a Trailing Stop counts as having a stop, and a Live Strategy can use it as its stop.
What can a trailing stop not do?
#- It does not promise the exit price. If price jumps past the stop, the trade closes at a price beyond it.
- A tight trailing distance is hit by normal moves. A wide one gives back more of a gain before it closes the trade.
- On its own it has no exit target. It closes a trade only when price falls back to it, so a trade can end well below its highest point.
- It limits one trade, not the whole account. Stop loss and position sizing set how much is at stake at the start.
In Oalgo you can tell Oalgo AI your trailing stop rule, such as “a 2% trailing stop”, in your own words, check the rule it builds, and test it. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.
Read next
- What is a stop loss? How to set oneA stop loss closes a trade when price moves a set distance against it. Learn how a stop is set, what it cannot promise, and what a Live Strategy needs.
- What is ATR? Average True Range explainedATR measures how far price typically moves in one candle. Learn how it is calculated, how to read it, and how to use it in your own rules.