jpalonso-modoki
This EA uses the Envelopes indicator as a mean-reversion signal within the MQL5 Standard Library Expert Advisor framework. It opens trades when price touches or crosses the Envelopes bands, expecting a reversion to the moving average center line. The EA uses fixed lot sizing and no trailing stop, with hardcoded stop-loss and take-profit levels.
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 strategy concept of this EA is based on the mean-reversion principle of the Envelopes indicator. The Envelopes consist of a 200-period SMA middle band and upper/lower bands deviating 0.35% from the center, generating sell signals when price touches the upper band and buy signals when price touches the lower band, expecting price to revert to the mean. Entry conditions are controlled by the CSignalEnvelopes filter with a signal threshold of 10 (on a 0-100 scale), meaning trades only trigger when signal strength exceeds this threshold. Exit conditions rely on a 77-point stop-loss and 127-point take-profit, with a close signal threshold of 10 allowing reverse signals to close positions. Position sizing uses fixed lots (CMoneyFixedLot) at a default of 5 lots, with no dynamic adjustment based on account balance. Money management is set at 10% ratio combined with fixed lots, though the fixed lot value dominates in practice. Notably, OnTick includes a PositionSelect check preventing new positions when one already exists, and there is a hardcoded time filter restricting trading to after October 8, 2012.
Strengths
- Built on the MQL5 Standard Library framework with clean, well-structured code that is easy to understand and extend
- Envelopes mean-reversion strategy has clear logic with a 200-period SMA providing strong trend reference
- Stop-loss and take-profit protection with a favorable risk-reward ratio of approximately 1:1.65 (127 TP vs 77 SL)
- PositionSelect check prevents opening new positions when one already exists, avoiding redundant entries
Weaknesses
- Hardcoded time filter (D'2012.10.08 10:55') renders the EA non-functional in current time without manual modification
- Default 5-lot fixed position size is excessively large and dangerous for small accounts, lacking dynamic sizing
- No trailing stop (CTrailingNone) means floating profits cannot be locked in, potentially giving back significant gains in trending moves
- No spread filter, which is problematic for a mean-reversion strategy that may lose to transaction costs in wide-spread conditions
- Relies on a single Envelopes indicator without multi-confirmation, making it susceptible to false signals
Possible improvements
- Remove the hardcoded time filter and replace with a configurable trading session filter or delete it entirely
- Replace fixed lots with dynamic position sizing based on account balance and risk percentage to reduce risk for small accounts
- Add trailing stop to protect profits in favorable moves, and add a spread filter to avoid high-cost trades
- Add multi-confirmation mechanisms (e.g., RSI overbought/oversold, volume verification) to reduce false signals
Risk assessment
Overall risk: Caution
- Hardcoded time filter makes the EA completely non-functional currently and must be modified before use
- Default 5-lot fixed position size poses extreme risk for most accounts, potentially causing account blowout
- No trailing stop may result in significant profit givebacks during trending markets
- Mean-reversion strategy can suffer consecutive losses during strong trending markets
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Signal_ThresholdOpen | 10 | Open position signal threshold [0...100] |
Signal_ThresholdClose | 10 | Close position signal threshold [0...100] |
Signal_PriceLevel | 0.0 | Trade execution price level; 0 = market order |
Signal_StopLevel | 77.0 | Stop loss level (points) |
Signal_TakeLevel | 127.0 | Take profit level (points) |
Signal_Expiration | 4 | Pending order expiration (number of bars) |
Signal_Envelopes_PeriodMA | 200 | Envelopes MA period |
Signal_Envelopes_Shift | 0 | Envelopes time shift |
Signal_Envelopes_Method | MODE_SMA | MA calculation method |
Signal_Envelopes_Applied | PRICE_CLOSE | Applied price type |
Signal_Envelopes_Deviation | 0.35 | Envelopes deviation percentage |
Signal_Envelopes_Weight | 1.0 | Signal filter weight [0...1.0] |
Money_FixLot_Percent | 10.0 | Money management percentage |
Money_FixLot_Lots | 5.0 | Fixed lot size |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.