A stop loss is an order attached to an open position that closes it if the market moves against you to a specified price. It defines the most you intend to lose on the trade before the trade is placed, and it is the one decision in trading that is made calmly, in advance, rather than under pressure.
Where a stop goes
There are three common ways to set the distance. A fixed distance in pips or points, which is simple but ignores how much the market normally moves. A distance based on volatility, typically a multiple of the average true range, so that the stop is wider in a volatile market and tighter in a quiet one. Or a distance based on the chart, placed beyond a recent swing low or high, on the reasoning that if price gets there the idea behind the trade was wrong.
Whichever method is used, the stop distance and the position size are linked. Together they decide the amount at risk, and the position size should be worked out from the stop, not the other way round. The page on position sizing covers the arithmetic.
A stop is not a guarantee
Once a stop loss is triggered it becomes a market order, filled at the next available price. In an ordinary market that is within a point or two of the stop level. In a fast market, or when the price gaps over the level, it can be much further. A stop at 1.2650 in a pair that opens on Monday at 1.2580 will be filled at around 1.2580, 70 pips worse than intended.
Some brokers offer guaranteed stops for an additional charge, usually a wider spread on the instrument. For most trading they are not worth it. For positions held over weekends in markets that gap, they can be.
Hard stops and mental stops
A hard stop is placed with the broker and held on the broker's server, so it will execute whether or not your platform is connected. A mental stop is a level you intend to act on yourself. Mental stops fail in exactly the circumstances they are meant for. The market moves faster than expected, the trader hopes, and the loss grows. Every trade should carry a hard stop.
EUR/USD is at 1.0850 and the 14-day average true range is 60 pips. A trader who uses a stop of one and a half times the ATR sets it 90 pips away, at 1.0760. On a £10,000 account risking one per cent, or £100, that stop distance allows about 0.14 lots. The same trader on a day when the ATR is 40 pips would set a 60-pip stop and trade about 0.21 lots. The risk in pounds is the same on both days. The exposure adapts to the market.
An EA can hold its stop in one of two places. A server-side stop is sent to the broker with the order and executes regardless of what happens to the EA, the VPS or the connection. A virtual stop, sometimes marketed as a hidden stop, is kept in the EA's own memory and executed by sending a close order when the level is reached. The argument for virtual stops is that they cannot be seen by the broker. The argument against is that if the VPS restarts, the internet drops or the platform crashes, the stop does not exist, and the position is unprotected until the EA is running again.
For that reason a hard stop held at the broker on every position is the safer design, and an EA that does not place one is asking you to trust its uptime. Some EAs move the stop to breakeven once a trade is in profit, or trail it behind the price. Those are refinements. The stop being there at all, from the moment the position opens, is the requirement.