- Strategy
- Does not open trades. When it finds a position without a stop-loss or take-profit, it adds them at the configured distance from the open price.
- Risk model
- Opens no trades; makes sure every managed position carries a stop-loss and, optionally, a take-profit
What it does
Auto SL TP EA closes a common gap in risk control: a position opened in a hurry, from a phone, or by a signal service without a stop-loss. It checks every second and adds a stop and a target to any position that has none. It never opens or closes trades and never changes a stop or target that is already set.
How it works
For each open position (looped from last to first and selected by ticket) that passes the symbol and magic filters:
- If the stop is missing, a distance is calculated, either fixed points or ATR × multiple on the chosen timeframe, and the stop is placed that far from the open price.
- If price has already moved beyond that planned stop, the distance is measured from the current price instead (never closer than the broker's stops level), and the log says so.
- If the target is missing, it is placed from the open price by points, by ATR, or by R multiple × the stop distance. A target that price has already passed is not added.
- The broker's stops and freeze levels are respected. A failed modification is retried after 30 seconds.
The grace period lets you set your own levels first; the EA only acts if they are still missing after that time.
How to use it
Attach it to one chart. For account-wide protection, choose "All symbols". If you use EAs that add their stops a moment after entry, set a grace period of a few seconds, or limit the tool to manual positions with the magic filter. ATR mode adapts the stop to each symbol's volatility; points mode is predictable but must suit every symbol in scope.
Settings
| Input | Default | What it changes |
|---|---|---|
| Add stop-loss | true | Adds missing stops |
| Stop-loss mode | ATR | Points or ATR |
| Stop (points) / (x ATR) | 300 / 1.5 | Stop distance |
| Add take-profit | true | Adds missing targets |
| Take-profit mode | R multiple | None, points, ATR or R |
| Target points / ATR / R | 600 / 3.0 / 2.0 | Target distance |
| Grace period (seconds) | 0 | Delay before acting |
| ATR timeframe / period | chart / 14 | ATR source |
| Symbols / Positions | Chart / All | Scope |
Limitations
A stop chosen by a fixed rule does not know your trade idea; it may be too tight or too wide for a particular setup. Between the open and the first check the position is unprotected, and nothing happens while the terminal is off. Points mode applied to many symbols can produce unsuitable distances, for example on gold versus EUR/USD.
Before you run it live
Open small manual trades on a demo account and check where the levels are placed for each symbol you use. Make sure the distances make sense with your position size, using the Position Size Calculator. Trading carries a substantial risk of loss.

