Exp_ADXCrossing
This EA trades based on the ADXCrossing custom indicator, which signals trend direction changes when the +DI and -DI lines cross. It opens buy positions on upward crosses and sell positions on downward crosses, with configurable money management, stop loss, and take profit settings. The EA also supports closing opposite positions on signal reversal and uses a new-bar check to avoid repeated signals within the same bar.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
The strategy concept is based on the crossover of the +DI and -DI lines within the ADX indicator to identify trend direction changes. Entry conditions are: open a buy position when UpValue (+DI crossing above -DI) signal appears, and open a sell position when DnValue (-DI crossing above +DI) signal appears, read from the specified SignalBar. Exit conditions include fixed StopLoss and TakeProfit levels, as well as reverse signal triggered closes — a buy signal closes sell positions and a sell signal closes buy positions. Position sizing supports five modes via the MMMode parameter: free margin percentage, balance percentage, loss-adjusted free margin percentage, loss-adjusted balance percentage, and fixed lot size. Money management uses the MM parameter to control risk percentage or fixed lot size, defaulting to 0.1 lots. The EA also includes an enhanced logic: when both open and close permissions are enabled but no reverse close signal is detected on the current bar, it scans forward through historical bars to find an earlier reverse signal, serving as an extended close detection mechanism.
Strengths
- Clear strategy logic based on the classic ADX crossover signal with solid theoretical support for trend identification
- Five money management modes providing flexibility for different trading styles and risk preferences
- Independent control over open and close directions, allowing flexible configuration such as open-only or close-only modes
- New bar detection mechanism prevents repeated entries within the same bar, reducing overtrading
- Enhanced forward-scanning reverse signal detection for closes, reducing missed exit opportunities
Weaknesses
- ADX period of 50 is relatively long, causing significant signal lag that may miss substantial early trend movement
- StopLoss of 1000 points and TakeProfit of 2000 points are large fixed values without ATR-based dynamic adjustment, potentially unsuitable for all market conditions
- No spread filter or trading session filter, which may result in unfavorable fills during low-liquidity or high-spread periods
- The custom ADXCrossing indicator is not embedded, relying on an external file that can be missing during deployment, causing the EA to fail initialization
- The historical bar scanning close logic has no upper bound limit, potentially iterating through large amounts of historical data and impacting performance in extreme cases
Possible improvements
- Replace fixed StopLoss/TakeProfit with ATR-based dynamic calculation so risk parameters auto-adapt to different instruments and volatility environments
- Add spread filter and trading session filter to avoid opening positions during high-spread and low-liquidity periods
- Add a maximum lookback bar limit to the historical bar scanning close logic to prevent performance issues
- Embed the ADXCrossing indicator logic directly into the EA to eliminate external dependency and improve deployment reliability
Risk assessment
Overall risk: Medium
- Fixed stop loss and take profit not dynamically adjusted for market volatility, potentially causing excessive risk exposure or ineffective stops in different volatility environments
- No spread filter means high-spread markets may cause excessive entry slippage, significantly impacting risk-reward ratio
- External indicator dependency may cause EA initialization failure if users do not correctly deploy the indicator file
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Money management parameter controlling lot size or risk ratio |
MMMode | LOT | MM mode: Free margin/Balance/Free margin minus floating/Floating-adjusted balance/Fixed lot |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum allowed slippage in points |
BuyPosOpen | true | Allow buy position opening |
SellPosOpen | true | Allow sell position opening |
BuyPosClose | true | Allow buy signal to close sell positions |
SellPosClose | true | Allow sell signal to close buy positions |
InpInd_Timeframe | PERIOD_H1 | ADXCrossing indicator timeframe |
ADXPeriod | 50 | ADX indicator period parameter |
SignalBar | 1 | Signal bar index (0=current, 1=closed) |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.