Stop Loss
The Stop Loss feature closes a position to limit losses when the price moves against you. It can be disabled or configured with a fixed stop distance, and a trailing checkbox turns it into a trailing stop loss.
The feature is enabled per strategy but not mandatory, so a strategy can trade without any stop loss.
What the feature is for
Use this feature when you want to cap the maximum loss on each position. The stop can be expressed in pips, as a monetary loss, or as a percentage of equity.
Use Stop Loss
Adding the feature to the strategy enables it and removing it disables it. When disabled, the feature is removed from the feature list and no stop order is placed.
Trailing Stop Loss
The Trailing Stop Loss checkbox sits below the trade environment preview table and is off by default. It turns the same stop into a trailing stop that moves with the market when the position is in your favor, protecting profit while limiting the loss. The checkbox is labeled Trailing Stop Loss with the comment Trails once per bar:
- Off: the stop acts as a plain fixed Stop Loss.
- On: the stop acts as a Trailing Stop Loss. It is updated once per bar, at the bar open, using the previous completed bar's high for long positions and its low plus the spread for short positions. The level sits the configured distance away from that extreme and only moves when the new level improves the existing stop by at least one pip.
The level never moves beyond the current market price: the bid for long positions, the ask for short positions.
When trailing is on, the stop still starts at the configured distance from the entry fill, so new positions have the fixed initial stop before the trailing level is placed.
Unit
The unit determines how the stop value is interpreted:
- Pips: price distance in pips.
- Money (account ccy): maximum loss in the account currency.
- % of equity: a loss amount derived from the current account equity when the distance is calculated.
The value range changes with the unit:
- Pips: 1 to 100,000.
- Money: 1 to 100,000.
- % of equity: 0.1 to 100.
Reference
The reference determines the price the stop distance is measured from:
- First entry price: measured from the first entry of the position.
- Average price: measured from the average entry price of all fills.
- Last entry price: measured from the most recent entry.
The reference matters for strategies that add to a position, such as Add on Same Signal, Martingale, or Grid averaging down.
Grid averaging down has no separate stop-loss setting. Add this feature for Grid loss protection; it is not enabled automatically, and the built-in Grid Demo template does not include it.
Backtest behaviour
Equity-percent distances use current equity when the initial stop is placed and when an applicable add re-anchors it. A plain stop stays at its placed price between those events; it is not continuously moved as equity changes. With trailing enabled, the distance is recalculated from current equity, including floating profit/loss, at each existing per-bar trailing check. The MQL5 expert uses the same equity sampling rules.
Money and equity-percent distances are converted using the base entry volume, before Martingale scaling or position adds, and the account-currency conversion rate at the calculation price. An Equity percent or Progressive lots Entry amount recalculates that base volume too. Consequently, the realized loss on a scaled or aggregated position is not guaranteed to equal the configured money amount or equity percentage.
For protection conversion only, the base volume is clamped to the broker's lot limits and rounded to its lot step so an existing position keeps valid protections even when changing equity would make a new entry too small or too large. Actual entry orders are still rejected when outside those limits.
The stop level is anchored to the entry fill price: the bid for long entries, the ask for short entries. The distance from the fill price to the stop therefore includes the spread, which is why the pip preview adds the spread.
The distance is clamped by the broker's stop level: the engine uses the larger of the pip distance and stop level × point.
The stop is checked inside every bar. When the bar's range reaches the level, the position closes at the level. When a bar opens beyond the level (a gap), the position closes at the bar open. When the Stop Loss and the Take Profit levels are both inside the same bar, the bar is counted as ambiguous and the interpolation method decides which one fills first.
With the trailing checkbox on, the trailing level is updated once per bar at the bar open, from the previous bar's high (long) or low (short), and only moves in the profitable direction by at least one pip.
When the position grows (Add on Same Signal, Grid averaging down), the stop re-anchors to the reference price: First entry keeps the original level, while Average price and Last entry price move the stop with the new fills. A fixed stop re-anchors unconditionally; a trailing stop only moves in the profitable direction.
Trade environment preview
The feature shows a preview table that calculates the resulting stop level in the active account environment.
- Type: Fixed for a static stop, Trailing when the trailing checkbox is on.
- Distance: the configured stop distance in its own unit (pips, money, or % of equity).
- Stop Loss: the stop amount converted to the account currency, with the percent of the initial account in parentheses.
- Amount (lots): the entry volume the calculation is based on.
The pip distance adds the current spread: the stop is placed the configured number of pips away from the reference price, and closing the position also pays the spread.
The preview always shows the calculated values for the current settings; it does not depend on the feature toggle. It appears only when a valid trade context is loaded.
The preview uses the initial account and last close as an illustrative starting environment, not the current equity of an open position.
Example
EURUSD with a USD account, close price 1.08500, initial account 10,000 USD, entry volume 0.01 lots, current spread 1 pip:
| Unit | Stop value | Type | Distance | Stop Loss | Amount (lots) |
|---|---|---|---|---|---|
| Pips | 100 | Fixed | 100 pips | 10.10 USD (0.10%) | 0.01 |
| Money (account ccy) | 500 | Fixed | 500.00 USD | 500.00 USD (5.00%) | 0.01 |
| % of equity | 3.0% | Fixed | 3.00% of equity | 300.00 USD (3.00%) | 0.01 |
| Pips | 100 | Trailing | 100 pips | 10.10 USD (0.10%) | 0.01 |
With the 100 pips stop, the stop distance is 100 pips plus the 1 pip spread: 101 pips × 0.01 lots = 10.10 USD. The trailing checkbox does not change the calculated distance; it changes how the level moves after the entry.
Form fields
- Stop Loss: section header.
- Unit: pips, money, or % of equity.
- Stop Loss: the stop value with range and precision adjusted by unit.
- Trade environment preview: read-only calculated table.
- Trailing Stop Loss: checkbox, off by default, with the comment 'Trails once per bar'.
- Reference: first entry, average, or last entry price.