WamekEA MoveStopLoss
This EA is a trailing stop utility that moves the stop loss of existing positions as price moves in favor. It offers two modes: an ATR-based dynamic trail using 85% of the 30-bar max ATR, or a fixed-distance trail set by the user.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
Not backtested yet — this EA could not be converted automatically.
Strategy analysis
This EA does not open trades autonomously; it only manages the stop loss of existing positions. The trailing stop logic works as follows: for buy positions, when the current bid is above the open price and the current stop loss is below bid minus the trail distance, the stop loss is moved up to bid minus trail distance. For sell positions, when the current ask is below the open price and the current stop loss is above ask plus trail distance (or is zero), the stop loss is moved down to ask plus trail distance. The trail distance is determined in two ways: if AutoTrail is true, it uses 0.85 times the maximum ATR value over the last 30 bars; if false, it uses the fixed pip distance specified by Distance2Trail. The ATR calculation uses a 7-period ATR indicator, iterating over 30 bars to find the maximum and minimum, though only the maximum is used for trailing. Position sizing is not applicable as the EA never opens positions. Money management is entirely absent with no consideration of account equity or risk ratios.
Strengths
- Offers both ATR-based dynamic trailing and fixed-distance trailing modes, providing good flexibility
- ATR mode uses the 30-bar maximum as the basis, adapting to volatility changes and preventing stops that are too tight
- Handles the zero stop loss edge case for sell positions, ensuring positions without stops are not overlooked
Weaknesses
- ATR calculation is inefficient, iterating over 30 bars and calling CopyBuffer every tick instead of caching or updating only on new bars
- The 0.85 ATR multiplier is hardcoded and cannot be adjusted by the user, reducing adaptability
- No error handling for stop loss modification failures; the return value of trade.PositionModify is not checked
- Trailing only activates after price exceeds the open price, failing to protect small unrealized profits
- AtrMin variable is calculated but never used, representing dead code
Possible improvements
- Make the ATR multiplier (0.85) and ATR lookback period (30) adjustable input parameters for greater flexibility
- Update ATR values only on new bar formation instead of every tick for significant performance improvement; also check PositionModify return values and log errors
- Add a minimum profit distance parameter to allow trailing before price exceeds the open price; add a minimum step check to avoid excessively frequent stop loss modifications
Risk assessment
Overall risk: Low
- No error handling when PositionModify fails, which could leave the stop loss unmoved without the user being aware
- Recalculating ATR and attempting stop loss modifications every tick may trigger server rate limits during high volatility
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
AutoTrail | true | ATR trailing stop mode; false=fixed distance |
Distance2Trail | 300 | Fixed trail distance in points, used when AutoTrail=false |
Similar Utility EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.