Flat Trend EA
Flat Trend EA is a mean reversion expert advisor that identifies flat/ranging market conditions using a flat trend indicator and enters trades when price deviates from its range equilibrium. It aims to capitalize on price returning to the mean during sideways markets by detecting overbought and oversold conditions within a defined channel.
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 | -5.16% | -4.50% | 6.07% | 116 | 47.80% | — | — | — | — | Same as other EAs |
| GBPUSD | -1.90% | -1.65% | 4.87% | 118 | 45.30% | — | — | — | — | Same as other EAs |
| USDJPY | -5.55% | -4.84% | 8.83% | 115 | 46.50% | — | — | — | — | Same as other EAs |
| XAUUSD | +12.05% | +9.86% | 52.68% | 112 | 49.50% | — | — | — | — | Same as other EAs |
On every market this backtest is identical to EA-20304. The automatic conversion almost certainly lost what makes this EA different (a custom indicator, a filter or the money management), so these results are not ranked or counted.
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 identifying flat/ranging market states and executing mean reversion trades when price touches the upper or lower boundaries of a channel. Entry conditions: go short when the Flat Trend indicator shows a sideways market and price touches the upper channel band; go long when price touches the lower channel band. Exit conditions include: closing positions when price returns to the channel midline, reaching take-profit targets, or stop-loss being triggered. Position sizing uses a fixed lot approach with no dynamic lot adjustment mechanism detected. Money management lacks risk-proportional calculation and does not dynamically adjust position size based on account balance. The overall strategy logic is simple and straightforward but lacks a mechanism to distinguish between trending and ranging markets, which could lead to consecutive losses during trending periods.
Strengths
- Strategy logic is simple and clear, easy to understand and tune
- Performs well in ranging markets, effectively captures mean reversion opportunities
- Few parameters reduce the risk of overfitting
Weaknesses
- Lacks a trend filter, may suffer consecutive losses in trending markets
- Fixed lot position sizing is inflexible, does not consider account risk ratio
- Flat detection indicator may produce lagging signals, leading to poor entry timing
- Lacks new bar check mechanism, may open multiple positions on the same bar
Possible improvements
- Add a trend filter (e.g., ADX or moving average slope) to pause trading during trending markets
- Implement dynamic position sizing based on account risk ratio
- Add new bar check and time filter functionality to avoid duplicate entries and trading during inactive sessions
Risk assessment
Overall risk: Medium
- Lack of trend filter may cause sustained counter-trend trading in trending markets
- Fixed lot size does not account for account risk tolerance
- May lack new bar check leading to duplicate position openings on the same bar
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Lots | 0.1 | Fixed trading lot size |
TakeProfit | 50 | Take profit in points |
StopLoss | 30 | Stop loss in points |
FlatPeriod | 14 | Flat market detection period |
FlatLevel | 0.5 | Flat market determination threshold |
MagicNumber | 12345 | EA magic number |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.