Advanced Sltp Atr Trade Manager
- Experts
- Adithyo Dewangga Wijaya
- Versione: 2.20
Smart SLTP ATR Trade Manager
A trade management utility for MetaTrader 5 that automatically assigns Stop Loss and Take Profit levels to open positions, and trails Stop Loss as price moves in the trader's favor. Compatible with manual trades, Expert Advisors, and copy trading signals simultaneously.
Overview
The utility monitors all open positions on the chart and assigns SL/TP levels immediately upon trade entry, based on one of four configurable calculation modes. An optional step-based trailing system advances the Stop Loss incrementally as price progresses, locking in positive movement without closing the trade prematurely.
No trading signals are generated. The utility only modifies existing positions.
Calculation Modes
Four modes are available for SL/TP distance calculation:
Pips Mode — fixed pip distances from entry price.
Points Mode — fixed point distances, useful for broker-specific precision.
Money Mode — fixed monetary risk and reward amounts in account currency. The utility converts these to SL/TP distances automatically based on the current lot size.
ATR Dynamic Mode — volatility-adaptive levels calculated using the Average True Range indicator. SL and TP are placed at a configurable multiple of the current ATR value, so distances widen during high-volatility sessions and narrow during low-volatility periods. The ATR timeframe, period, shift, and separate multipliers for SL and TP are all configurable.
Example: ATR = 50 points, SL multiplier = 1.5 → SL placed 75 points from entry.
Step Trailing System
An optional structured trailing mechanism with three configurable parameters:
Activation Threshold — minimum profit in pips before trailing begins.
Step Size — increment by which SL advances each time price moves further in the trade's favor.
Breakeven Buffer — minimum profit in pips locked above entry when trailing activates.
The Stop Loss only moves in the favorable direction. It never retreats. ATR-based trailing is also available, which scales the activation threshold and step size proportionally to the current ATR value.
Example with 50-pip activation, 5-pip step, 5-pip buffer:
- Price moves +50 pips → SL moves to entry +5 pips
- Price moves +55 pips → SL advances to entry +10 pips
- Price moves +60 pips → SL advances to entry +15 pips
- Continues incrementally as long as price moves favorably
Trade Filtering
The utility can be configured to manage:
- All open positions on the chart
- Positions on the current symbol only
- Positions from a specified magic number only
- Positions matching both a specified symbol and magic number
Multiple instances of the utility can run simultaneously on the same chart, each managing a different filtered subset of trades.
On-Chart Panel
A real-time information panel displays the current status of the utility, including: active/disabled state, calculation mode, current ATR value (if applicable), configured SL/TP distances, trailing status and activation level, number of managed positions, number of actively trailing positions, and current spread.
Broker Compatibility
The utility validates SL/TP distances against the broker's minimum stop level (SYMBOL_TRADE_STOPS_LEVEL) and widens levels automatically if the configured distance falls below the broker's requirement. It adapts to 3-digit, 4-digit, and 5-digit brokers. Pip detection for XAUUSD (10-point pips) is handled automatically.
An optional spread filter pauses SL/TP assignment when the current spread exceeds a configurable threshold. Slippage tolerance for order modification is also configurable.
No DLL dependencies. No external network requests. Compatible with all MT5 builds 1600 and above.
SL/TP Assignment Rule
Two options are available:
Always Overwrite — replaces any existing SL/TP on every managed position.
Only If Zero — applies SL/TP only to positions that currently have none, leaving manually set levels untouched.
Strategy Tester
A built-in simulation mode generates random trades during backtesting to demonstrate SL/TP assignment and trailing behavior visually. This mode is automatically disabled during live trading.
Input Parameters (31 total)
General: EA enable/disable, calculation mode, SL/TP apply rule, dashboard visibility.
SL/TP (Pips/Points/Money): Stop Loss distance, Take Profit distance, Stop Loss in money, Take Profit in money.
ATR: Timeframe, period, shift, SL multiplier, TP multiplier.
Trailing: Enable trailing, activation threshold, step size, breakeven buffer, ATR-based trailing toggle, ATR activation factor, ATR step factor.
Filter: Filter mode, magic number, maximum spread, maximum slippage.
Backtest: Enable simulation mode, lot size, trade interval in bars.
Recommended Configurations
XAUUSD — short-term: ATR Dynamic, M15 timeframe, ATR period 14, SL multiplier 1.0, TP multiplier 2.0, trailing enabled with 30-pip activation and 5-pip step.
XAUUSD — medium-term: ATR Dynamic, H4 timeframe, ATR period 14, SL multiplier 1.5, TP multiplier 3.0, ATR-based trailing enabled.
EURUSD: Pips mode, SL 20 pips, TP 40 pips, trailing activation 20 pips, step 5 pips.
GBPUSD: Pips mode, SL 25 pips, TP 50 pips, trailing activation 25 pips, step 5 pips.
USDJPY: Pips mode, SL 15 pips, TP 30 pips, trailing activation 15 pips, step 3 pips.
Installation
- Place the compiled EX5 file into the MQL5/Experts/ folder (accessible via File > Open Data Folder in MT5).
- Attach the utility to a chart via the Navigator panel (Ctrl+N).
- In the EA dialog, enable "Allow Algo Trading" and configure the desired input parameters.
Risk Notice
This utility is a trade management tool. It does not generate trading signals or open positions. It does not influence trading outcomes beyond the SL/TP and trailing behavior described above. Past behavior in the Strategy Tester does not indicate future results. All trading decisions and position sizing remain the sole responsibility of the user.
Product Details
Version: 1.0. Compiled with zero errors and zero warnings. Supported on all MT5 builds 1600 and above. All input parameter names, interface text, and screenshots are in English.
The utility is compatible with any Expert Advisor running on the same chart. By configuring the trailing activation threshold and breakeven buffer, traders can set a minimum pip distance that the Stop Loss must clear before trailing begins, ensuring the position is not closed at a loss once that threshold is reached.
