Exp_EF_distance
This EA trades based on the EF_distance indicator, which measures the efficiency of price movement to detect trend direction. It opens buy positions when the EF_distance values indicate an upward trend (Value[0]>Value[1]<Value[2]) and sell positions when they indicate a downward trend, with an optional Flat-Trend volatility filter in the full version.
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 is based on the EF_distance indicator, which measures the efficiency of price movement to determine trend strength and direction. Entry conditions for buy positions require the EF_distance values to show a descending pattern over the prior two bars (Value[1]<Value[2]) with the current bar reversing upward (Value[0]>Value[1]), and the full version additionally requires the Flat-Trend volatility indicator to meet or exceed the configured volatility threshold. Sell entry conditions are the mirror opposite, requiring an ascending pattern that reverses downward. Exit conditions are triggered by opposing signals — a long position is closed when a sell signal appears and vice versa, with fixed StopLoss and TakeProfit in points. Position sizing is controlled by the MM parameter, where negative values represent fixed lot sizes and positive values represent a share of the deposit. Money management is handled through the TradeAlgorithms.mqh library functions, but there is no dynamic adjustment of stop-loss, take-profit, or trailing stop mechanism. The full version (exp_ef_distance.mq5) adds the Flat-Trend indicator as a volatility filter, only allowing entries when market volatility is sufficient, which improves signal quality.
Strengths
- Full version combines a volatility filter to avoid frequent entries in low-volatility choppy markets
- Uses new bar detection (CIsNewBar) to prevent duplicate trades within the same bar
- Provides independent toggle switches for buy/sell opening and closing, offering high flexibility
- Supports automatic lot sizing based on deposit share, aiding money management
- Dual-indicator confirmation mechanism reduces false signals
Weaknesses
- Stop-loss and take-profit are fixed points without dynamic adjustment based on market volatility (ATR), which may be inappropriate across varying market conditions
- Lacks a trailing stop mechanism, so profitable positions may give back most gains during pullbacks
- No spread filter, which can lead to slippage losses on instruments with wide spreads
- EF_distance indicator logic is opaque, making parameter optimization lack intuitive guidance
- Signal generation logic is simplistic, relying on comparison of only 3 bars of indicator values, which may produce frequent false reversal signals
Possible improvements
- Replace fixed stop-loss/take-profit with ATR-based dynamic levels to adapt risk management to market volatility
- Add a trailing stop feature to protect accumulated profits from significant pullbacks
- Add spread and slippage filters to avoid opening positions when spreads are excessively wide
- Add maximum position count limits and maximum drawdown protection to prevent excessive losses in extreme market conditions
Risk assessment
Overall risk: Medium
- Fixed stop-loss/take-profit does not adapt to market volatility — stop may be too wide in low volatility and take-profit too small in high volatility
- Lacks trailing stop, so winning positions can retrace significantly into loss territory
- No spread filter or maximum drawdown protection mechanism
- When MM parameter is negative (fixed lot), small accounts may result in excessive leverage
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | -0.1 | Money management percentage for lot calculation |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Max price deviation in points |
BuyPosOpen | true | Allow buying |
SellPosOpen | true | Allow selling |
BuyPosClose | true | Allow closing long positions |
SellPosClose | true | Allow closing short positions |
InpInd_Timeframe | PERIOD_H4 | Indicator timeframe |
SignalBar | 1 | Bar index for entry signal |
XLength | 10 | EF_distance smoothing depth |
Power | 2.0 | EF_distance averaging power |
IPC | PRICE_CLOSE | Price constant type |
StDevPeriod | 20 | Standard deviation period (full version) |
StDev_Method | MODE_LWMA | Standard deviation smoothing method (full version) |
StDevLength | 5 | Standard deviation smoothing depth (full version) |
StDevPhase | 15 | Standard deviation smoothing phase (full version) |
ATRPeriod | 20 | ATR period (full version) |
ATR_Method | MODE_LWMA | ATR smoothing method (full version) |
ATRLength | 5 | ATR smoothing depth (full version) |
ATRPhase | 15 | ATR smoothing phase (full version) |
Volatil | V3 | Volatility threshold for trade execution (full version) |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.