A stop loss is an order that closes a trade automatically if price moves against you by a set amount; a take profit closes it automatically once price has moved in your favour by a set amount. Together they fix both possible outcomes before the trade opens. The distance between them sets the reward-to-risk ratio, and that ratio sets the win rate you need just to break even: with a 20-pip stop and a 40-pip target (1:2), you break even winning 1 trade in 3, or 33.3%, before costs. There are three common ways to size them - a fixed number of pips, a percentage of the entry price, or a multiple of ATR - and every automated strategy needs both, set on purpose rather than left to defaults.
A worked example
A buy on EURUSD at 1.1000 with 0.10 lots ($1 per pip):
| Price | Distance | Result at 0.10 lots | |
|---|---|---|---|
| Entry | 1.1000 | - | - |
| Stop loss | 1.0980 | 20 pips below | −$20 |
| Take profit | 1.1040 | 40 pips above | +$40 |
Reward-to-risk is 40 ÷ 20 = 2, written 1:2. Spread and commission come out of every trade, so the real break-even is a little higher - how spread sets your break-even win rate.
Reward-to-risk and the win rate you need
Break-even win rate = 1 ÷ (1 + reward-to-risk). Before costs:
| Stop : target | Reward-to-risk | Break-even win rate |
|---|---|---|
| 2 : 1 (stop twice the target) | 0.5 | 66.7% |
| 1 : 1 | 1 | 50.0% |
| 1 : 1.5 | 1.5 | 40.0% |
| 1 : 2 | 2 | 33.3% |
| 1 : 3 | 3 | 25.0% |
Neither column wins on its own: a 1:3 target needs only 25% winners but is reached less often. What predicts profit is the combination - trade expectancy.
Stop loss: your answer to "what if I'm wrong"
A stop loss isn't a prediction that the trade fails - it's the point, decided in advance, where you accept that it has. Setting it before entry, not while watching a position move against you, is what keeps a small loss from becoming a large one.
Take profit: closing the win before it reverses
A take profit closes the trade once the expected move has happened, instead of leaving you to guess when a winner is done. The alternative is a trailing stop, which follows price and lets a winner run while locking in part of the gain.
Three ways to size them
| Method | Example | Good for | Watch out for |
|---|---|---|---|
| Fixed pips | Stop 20 pips, target 40 pips | Simple, easy to reason about | 20 pips is small on a volatile day and large on a quiet one |
| % of entry price | Stop 0.5% below entry | Comparing instruments with very different prices | Ignores how much the instrument is actually moving |
| Multiple of ATR | Stop 1.5 × ATR(14) | Adapting to current volatility | Stop distance changes, so lot size must follow (ATR stop sizing) |
In AlgoPuzzle the stop loss and take profit blocks take pips, a % of entry price or a raw price distance, or a calculation such as 2 × ATR. However you size the stop, the lot size has to match it - that's position sizing.
Where to place them
- Beyond a level the idea depends on - below the recent swing low for a buy, so the stop only triggers if the idea is wrong, not on routine noise.
- Clear of the spread and the broker's minimum distance. Stops placed too close are rejected - see the invalid stops error.
- Consistent across the backtest. Changing stop rules trade by trade makes a backtest meaningless.
Common questions
What is the difference between a stop loss and a take profit?
A stop loss closes a trade automatically when price moves against you by a set amount, limiting the loss. A take profit closes it automatically when price moves in your favour by a set amount, locking in the gain.
What is a good risk-reward ratio?
There is no single best ratio. The ratio sets the win rate needed to break even: 1 / (1 + reward-to-risk). A 1:2 ratio breaks even at 33.3% winners, a 1:1 ratio at 50%, before spread and commission.
How far should my stop loss be?
Far enough that normal price noise does not trigger it - often beyond a recent swing high or low or a multiple of ATR - and never closer than the broker's minimum stop distance. Then size the position so that distance risks the amount you planned.
Should I always use a take profit?
Not necessarily. A fixed take profit gives a known reward-to-risk; a trailing stop lets winners run further but gives back part of the gain when price reverses. Every trade should have a stop loss either way.