Exp_SlopeDirectionLine
This EA trades based on the SlopeDirectionLine custom indicator, opening buy positions when the indicator signals an uptrend (value=2) and sell positions when it signals a downtrend (value=0). It uses a double-smoothing approach with configurable smoothing methods and manages both entry and exit signals independently with separate toggle switches.
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 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
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 core strategy is a trend-following system based on the SlopeDirectionLine indicator. Entry conditions: a buy position opens when indicator buffer 1 value changes from non-2 to 2 (uptrend onset), and a sell position opens when it changes from non-0 to 0 (downtrend onset), signaling trend direction changes. Exit conditions: existing sell positions close when an uptrend signal appears, and existing buy positions close when a downtrend signal appears, implementing automatic position closure on trend reversal. Position sizing supports multiple margin modes (MMMode) including free margin-based, balance-based, loss-adjusted free margin, loss-adjusted balance, and fixed lot size. Money management is controlled by the MM parameter with a default of 0.1, representing the risk fraction per trade. The indicator itself employs a dual-smoothing algorithm where the first layer applies primary smoothing to price data (e.g., LWMA) and the second layer further smooths the result (e.g., SMA), producing a smoother trend determination line.
Strengths
- Dual-smoothing algorithm reduces false signals and provides more stable trend determination
- Independent control of entry and exit signals offers high flexibility
- Multiple money management modes accommodate different trading styles
- New bar detection mechanism prevents repeated trading on the same bar
- Multiple notification options (push, email, alert, sound) for signal awareness
Weaknesses
- Depends on the custom SlopeDirectionLine indicator, requiring correct loading and availability
- Default StopLoss of 1000 points and TakeProfit of 2000 points are very large and may not suit all instruments
- No scaling in/out logic, making position management relatively simplistic
- No spread filter included, potentially leading to unfavorable fills in wide-spread environments
- Indicator value judgment relies only on discrete values 0 and 2, lacking handling of intermediate states
Possible improvements
- Add spread filter and trading session filter to avoid unfavorable trading conditions
- Implement trailing stop functionality to better protect profits during trending moves
Risk assessment
Overall risk: Medium
- Default StopLoss of 1000 points is large and may result in significant per-trade losses
- No spread filter means severe slippage possible in low-liquidity markets
- Dependency on external indicator file means EA fails if the indicator cannot load
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Money allocation ratio |
MMMode | LOT | Position size calculation mode |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum slippage deviation |
BuyPosOpen | true | Allow buy position opening |
SellPosOpen | true | Allow sell position opening |
BuyPosClose | true | Allow buy position closing |
SellPosClose | true | Allow sell position closing |
InpInd_Timeframe | PERIOD_H4 | Indicator timeframe |
MA_Method1 | MODE_LWMA | First-level smoothing method |
Length1 | 12 | First-level smoothing period |
Phase1 | 15 | Phase parameter for 1st smoothing level |
MA_Method2 | MODE_SMA | 2nd level smoothing method |
Phase2 | 15 | Phase parameter for 2nd smoothing level |
IPC | PRICE_CLOSE | Applied price type |
On_Push | false | Enable push notifications |
On_Email | false | Enable email notifications |
On_Alert | true | Enable alert notifications |
On_Play_Sound | false | Enable sound notifications |
NameFileSound | expert.wav | Sound file name |
CommentSirName | SlopeDirectionLine: | Order comment prefix |
SignalBar | 1 | Signal bar index |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.