Exp_MFI_Histogram
This EA trades based on the MFI (Money Flow Index) Histogram custom indicator, opening buy positions when MFI crosses above the lower level from the overbought zone and sell positions when MFI crosses below the upper level from the oversold zone. It uses a custom MFI_Histogram indicator with color-coded buffers to determine market direction and executes trades with configurable money management, stop loss, and take profit.
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 | -3.61% | -3.14% | 7.52% | 16 | 33.30% | — | — | — | — | Same as other EAs |
| GBPUSD | +2.91% | +2.52% | 7.12% | 19 | 42.10% | — | — | — | — | Same as other EAs |
| USDJPY | +8.76% | +7.57% | 4.07% | 33 | 53.10% | — | — | — | — | Same as other EAs |
| XAUUSD | +47.03% | +37.50% | 55.70% | 150 | 53.30% | — | — | — | — | Same as other EAs |
On every market this backtest is identical to EA-1101. 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 core strategy of this EA uses MFI Histogram indicator color changes to detect momentum shifts. Entry conditions: when buffer 1 (color value) transitions from 2 (overbought zone, blue) to 0 and buffer 0 value is greater than 0, it signals an uptrend and opens a buy position; when buffer 1 transitions from 0 to 2 and buffer 0 value is less than 2, it signals a downtrend and opens a sell position. Exit conditions include reverse signal triggers for closing positions, plus stop loss and take profit levels. Position sizing supports five modes: percentage of free margin, percentage of balance, percentage of net free margin, percentage of net balance, and fixed lot size. Money management is controlled via the MM parameter and MMMode enumeration, defaulting to fixed lot mode (LOT). The strategy operates on the H4 timeframe, representing a medium-term momentum-following approach, with signals based on the previous bar's indicator values (SignalBar=1) to avoid repainting issues.
Strengths
- Uses MFI momentum indicator with clear logic; signals are based on zone crossover rather than a single threshold, reducing false signals
- Supports five position sizing modes, flexibly adapting to different risk preferences and account sizes
- Signals are based on completed bars (SignalBar=1), avoiding repainting issues and ensuring reliable backtesting results
- Buy and sell switches are independently controlled, allowing flexible configuration such as long-only or short-only modes
Weaknesses
- Stop loss of 1000 points and take profit of 2000 points are very large, which may cause significant losses in extreme market conditions
- Lacks spread filtering, which may result in unfavorable entry prices in high-spread environments
- Depends on a custom MFI_Histogram indicator; the EA will fail to run if the indicator file is missing
- No position check or maximum position limit, potentially leading to over-opening on consecutive signals
Possible improvements
- Add spread filtering and maximum position count limits to improve risk control
- Implement a trailing stop feature to protect floating profits and optimize exit logic
Risk assessment
Overall risk: Medium
- Very large stop loss (1000 points), single trades may incur significant losses
- No position count check, consecutive signals may lead to multiple stacked positions increasing risk
- Depends on external custom indicator; when indicator fails to load, EA only prints a warning but does not abort initialization
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Margin usage ratio for lot size calculation |
MMMode | LOT | Position sizing mode (free margin/balance/net loss/fixed lots) |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum allowed slippage |
BuyPosOpen | true | Allow opening long positions |
SellPosOpen | true | Allow opening short positions |
BuyPosClose | true | Allow closing long positions |
SellPosClose | true | Allow closing short positions |
InpInd_Timeframe | PERIOD_H4 | Indicator calculation period |
MFIPeriod | 14 | MFI indicator period |
VolumeType | VOLUME_TICK | Volume type: tick volume or real volume |
HighLevel | 60 | Overbought level line |
LowLevel | 40 | Oversold level line |
SignalBar | 1 | Bar index for signal (0=current bar) |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.