Exp_ATR_Trailing
This EA is a trailing stop utility that modifies the stop-loss of existing open positions based on the ATR_Trailing custom indicator. It does not open new positions itself; it only trails stop-losses for already-open buy or sell positions. The trailing logic tightens stops as price moves in favor, locking in profits according to ATR-based levels.
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
The strategy concept uses the ATR (Average True Range) indicator to dynamically adjust stop-loss levels for existing positions, implementing a trailing stop mechanism. Regarding entry conditions, the EA does not execute any opening trades itself; it only manages already-opened positions. Exit conditions are implemented via trailing stops: for long positions, the indicator's lower band serves as the stop reference, with the stop only moving upward never downward; for short positions, the indicator's upper band is used, with the stop only moving downward never upward. For position sizing, the EA does not handle lot size calculation since it only modifies existing position stops and take-profits. Money management is entirely absent from the EA logic, relying completely on the user's initial position size when they opened the trade. When a position has no stop-loss, the EA sets an initial stop based on the indicator values on a new bar; when a stop already exists, it only modifies it when the indicator provides a more favorable stop level.
Strengths
- ATR-based trailing stops adapt to market volatility automatically — wider stops in volatile markets, tighter in calm markets
- Stops only move in the favorable direction (up for longs, down for shorts), effectively locking in unrealized profits
- New bar detection mechanism prevents excessive modification requests, reducing trade server load and network traffic
- Clean code structure with buy and sell modification logic separated into distinct functions for readability and maintainability
Weaknesses
- The EA does not open positions itself, requiring manual entry or pairing with another EA, which is inconvenient
- Uses ORDER_FILLING_FOK fill mode which some brokers do not support, potentially causing modification failures
- The sell position modify function uses Ask price instead of Bid as reference, which is logically inconsistent for short positions
- No Magic Number filtering means it modifies all positions on the symbol regardless of which strategy opened them
- StopCorrect function returns false when SYMBOL_TRADE_STOPS_LEVEL is 0, breaking functionality on brokers where this value is zero
Possible improvements
- Add a Magic Number filter parameter to manage only specific strategy positions and avoid accidentally modifying other EAs' positions
- Fix StopCorrect function logic when SYMBOL_TRADE_STOPS_LEVEL is 0 — should return true or use an alternative minimum stops level
- The sell position modify function should use Bid price instead of Ask as the basis for stop-loss calculation
- Add automatic detection or selection of ORDER_FILLING type for better broker compatibility
- Add visual display of the current trailing stop level by drawing stop lines on the chart
Risk assessment
Overall risk: Safe
- This EA is only a trailing stop tool that does not open positions, creating no new risk exposure
- Lack of Magic Number filtering could lead to accidental modification of other strategies' stops
- Hardcoded ORDER_FILLING_FOK may cause modification failures on some brokers but will not cause financial loss
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Period_ATR | 14 | ATR indicator period |
Sell_Factor | 2.0 | ATR stop-loss multiplier for short positions |
Buy_Factor | 2.0 | ATR stop-loss multiplier for long positions |
Deviation | 10 | Slippage tolerance in points |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.