This guide covers installation, run modes, ready-made set files and common questions for FXEA365 Megamax Donchian on MetaTrader 5. Megamax Donchian is a USDJPY H1 trend follower built around a Donchian channel breakout with an ATR stop and an ATR trailing stop. It runs on a hedging account. Next to the trend engine it contains a second, optional engine called PEACE, which averages into losing positions. PEACE is ON by default, and this guide explains what that means and how to turn it off. The signal is the same in every run mode; only the risk percentage changes.
Installation and first run
- Open a USDJPY chart and set it to H1. The USDJPY preset reads the chart timeframe, and every published result was measured on H1, so do not use any other timeframe.
- Drag the EA from the Navigator onto the chart, tick "Allow Algo Trading" in the Common tab, and make sure the AutoTrading button in the terminal toolbar is on.
- Use a hedging account. On a netting account the EA prints a warning at start-up and position management may not work as designed.
- Symbol names with a suffix (for example USDJPYm) are fine. The PEACE engine only runs when the symbol name starts with USDJPY, so a broker symbol with a prefix in front of USDJPY runs the Donchian engine alone.
- Leave AssetPreset at its default (PRESET_USDJPY). With this preset the Donchian engine uses a 40-bar channel, an initial stop of ATR x 2.0, a trailing stop of ATR x 8.0 and a time stop after 60 bars. There is no fixed take-profit.
- A VPS is strongly recommended, so the EA runs through the 24/5 trading week without interruption. The Donchian trades send their stop-loss to the broker with the order. The PEACE positions are opened without a server-side stop; their basket exits (take-profit, basket stop, margin exit) are executed by the EA, so they work only while the EA is running.
Minimum deposit and leverage
- Leverage: 1:100 or higher.
- The description does not set a fixed minimum deposit. The published tests used $10,000. For very small balances a micro/cent account is recommended so the minimum lot is not oversized.
- Keep in mind that the PEACE basket stop is a fixed amount: -2000 in account currency, which is 20% of a $10,000 account. On a smaller account the same basket stop is a larger share of the balance.
Run modes and published drawdowns
Backtests are historical simulations, not a live record, and do not indicate future performance.
- Defensive: Donchian engine alone, real ticks, USDJPY H1, 2017.01-2026.06 (about 9.4 years), $10,000: +71%, profit factor 1.59, maximum equity drawdown 4.8%.
- Standard: the original balanced profile. No full-period result is published.
- Aggressive: Donchian engine alone, same test: +716%, profit factor 1.55, maximum equity drawdown 16.4% (relative 19.5%).
- Ultra (default), Donchian engine alone (v1.51, Exness USDJPY, 1-minute OHLC, 2017.01-2026.08, $10,000): +1,712%, profit factor 1.67, relative equity drawdown 64.6% (absolute 16.1%), relative balance drawdown 62.3% (reached in 2017), 438 trades.
- Ultra with PEACE on (same test to 2026.09.01, 1:500): +1,872%, profit factor 1.60, relative equity drawdown 56.3% (balance 54.9%), 4,153 trades. 2024 was a losing year for the added engine (-2,199). Only Ultra was tested with PEACE on.
No forward test is published for this EA.
Note that Defensive does not make PEACE smaller. The PEACE first lot is fixed at 0.02 and does not follow the run mode. The Defensive and Aggressive figures above were measured with the Donchian engine alone, so they describe a configuration with EnablePeace=false.
Set files
Each set below lists only the inputs that differ between the sets. All other inputs stay at their defaults. RunMode is an enum: 0 = Defensive (risk x0.5), 1 = Standard, 2 = Aggressive (risk x2.0), 3 = Ultra. The regime filter (RegimeFilter_Mode, default Auto) switches itself on in Ultra only.
Defensive
; RunMode 0 = MODE_DEFENSIVE
RunMode=0
EnablePeace=true
Copy these lines into a text file named MegamaxDonchian_Defensive.set, save it in MQL5\Presets, then load it in the EA's Inputs tab with Load.
Standard
; RunMode 1 = MODE_STANDARD
RunMode=1
EnablePeace=true
Copy these lines into a text file named MegamaxDonchian_Standard.set, save it in MQL5\Presets, then load it in the EA's Inputs tab with Load.
Aggressive
; RunMode 2 = MODE_AGGRESSIVE
RunMode=2
EnablePeace=true
Copy these lines into a text file named MegamaxDonchian_Aggressive.set, save it in MQL5\Presets, then load it in the EA's Inputs tab with Load.
Ultra
; RunMode 3 = MODE_ULTRA
RunMode=3
EnablePeace=true
Copy these lines into a text file named MegamaxDonchian_Ultra.set, save it in MQL5\Presets, then load it in the EA's Inputs tab with Load.
Prop-firm set (Defensive, PEACE off)
; RunMode 0 = MODE_DEFENSIVE
RunMode=0
EnablePeace=false
Copy these lines into a text file named MegamaxDonchian_Prop.set, save it in MQL5\Presets, then load it in the EA's Inputs tab with Load.
This is exactly the Donchian-only Defensive configuration measured above at 4.8% maximum equity drawdown. With EnablePeace=false the EA trades like v1.51: no averaging, every trade with its own ATR stop. Check your prop firm's daily and total loss limits against this figure before you start.
If you want any of the other modes without the averaging engine, change EnablePeace=true to EnablePeace=false in that set.
How the two engines work
- Donchian trend engine: buys a breakout beyond the recent Donchian channel, sets an initial stop at ATR x 2.0 and then trails the stop behind price. A position that has not developed is closed by the time stop. Lot size comes from a risk percentage of balance against the stop distance, with a maximum-lot cap; the run mode scales the risk. It uses no grid and no martingale.
- PEACE engine (own magic number, PeaceMagic 20261010): opens when ADX(14) on M5 is below 15, against the DI signal, and only in the direction of the D1 SMA(100) regime. It adds every 20 pips (at least 3 hours apart), up to 10 add-ons, so a basket can hold up to 11 positions. Each add-on lot is 1.5x the largest lot in the basket. The basket closes at +20 pips from the average price, or when its combined loss reaches -2000 in account currency (PeaceBasketSL), or when margin level falls below 150%. It does not open a new basket while a Donchian position is open.
- Protection for both: built-in calendar news pause, daily-loss stop, consecutive-loss guard and a weekend-close option.
FAQ
Q: Which chart and timeframe should I use?
A: USDJPY H1. All published results are H1 results. In the Strategy Tester, also select USDJPY and H1.
Q: Does it use martingale, grid or averaging?
A: The Donchian engine does not. The PEACE engine, on by default, averages into losing positions with growing lots (1.5x) and a basket stop instead of a per-trade stop. Set EnablePeace=false to run the Donchian engine alone.
Q: Why are there two drawdown figures at Ultra?
A: Because profits are reinvested, the absolute equity drawdown stays near 16% while the relative peak-to-trough drawdown reaches 64.6%. The relative figure is the swing you would live through.
Q: Which mode should I choose?
A: Ultra is the default, but Defensive, Standard or Aggressive suit everyday use. Choose the mode, and the PEACE setting, from the drawdown you can accept.
Q: What is the minimum account?
A: No fixed minimum is stated. The tests used $10,000 at 1:100 or higher (the PEACE test at 1:500). For very small balances use a micro/cent account, and remember the -2000 PEACE basket stop is a fixed amount.
Q: Can I use it on a prop-firm account?
A: Use the prop-firm set above: Defensive with EnablePeace=false (4.8% maximum equity drawdown in the backtest). The averaging engine is not suited to prop-firm loss limits.
Q: Do I need a VPS?
A: Yes, strongly recommended. The PEACE basket exits are handled by the EA, so the terminal must stay running.
Q: My broker calls the symbol USDJPYm or USDJPY.r. Does that work?
A: Yes. A suffix after USDJPY is fine for both engines. If the name has a prefix in front of USDJPY, the PEACE engine stays off.
Q: How do I check it in the Strategy Tester before buying?
A: Run the free demo on USDJPY H1 with "Every tick based on real ticks" from 2017.01 to today. Run Ultra, then Aggressive with the same settings, and compare trade count, profit factor and both drawdown figures with the results above. Your broker's history will not match ours exactly.
Q: What should I do during a drawdown?
A: Compare it with the drawdown of the mode you run. Trend following has long quiet stretches, so a losing month is normal. If the drawdown goes beyond what you accepted when you chose the mode, lower the mode or turn PEACE off; do not raise risk to win it back.
Q: How do updates work?
A: Updates are delivered through the MQL5 Market. After updating, check the version on the chart panel and reload your set file, because new inputs start at their defaults.
Risk warning
Trend following has a low win rate and long quiet stretches, and the PEACE engine can turn one basket into a much larger loss than any single Donchian trade. All results in this guide are backtests, which are historical simulations and do not indicate future performance. Start on a demo account, choose your run mode and the PEACE setting on purpose, and trade only money you can afford to lose.


