Watch Tri Engine Portfolio EA
- Experts
-
Sinmiloluwa Daniel Ogunmola
MQL5 developer focused on EAs that survive real brokers, not just the tester. - Versione: 1.2
- Attivazioni: 5
Three-engine portfolio EA (trend pullback, breakout, range reversion) with a shared open-risk cap, profit lock, news pause and daily loss limit.
One strategy rarely suits every market phase. Trend entries struggle in ranges, and range entries get run over in trends. This Expert Advisor runs three independent engines on one symbol, each with its own magic number and at most one open trade:
- Engine A, trend pullback: a higher-timeframe EMA 200 sets the bias, and an RSI(14) cross back through 40 (buys) or 60 (sells) on the entry timeframe times the entry.
- Engine B, breakout: a close beyond the 20-bar Donchian channel on the higher timeframe.
- Engine C, range reversion: only when higher-timeframe ADX(14) is below 20, a close back inside the Bollinger Bands (20, 2) after a close outside them. The target is the middle band when that gives at least 1:1, otherwise a fixed multiple of the stop.
Risk and management:
- Stops are a multiple of ATR; lot size comes from a fixed percentage of the balance. A new trade is skipped if the combined open risk of all three engines would exceed a set percentage of the balance.
- A profit lock moves the real stop loss to keep a set share of the favourable move once a trade reaches a set multiple of its risk (only ever tightened).
- No new entries after a set hour on Friday. In live trading, entries pause around high-impact news for the symbol's currencies (MetaTrader economic calendar; a calendar error never blocks trading; not active in the Strategy Tester).
- A daily loss limit closes all trades and pauses until the next day; an optional total drawdown floor stops the EA.
- A panel shows each engine's status, last signal, total open risk and the day's result.
Before every order the EA takes a fresh price, keeps stop loss and take profit outside the broker stops level, freeze level and spread, rounds prices to the symbol tick size and checks volume limits and free margin for the exact order type. It never increases the lot after a loss and uses no grid, martingale or averaging. It does not use DLLs, web requests or external services, and it runs on any symbol and timeframe.
Recommended symbols and timeframes
- Entry timeframe M15 with H1 as the higher timeframe (inputs InpTF and InpHTF); the chart timeframe does not matter.
- Liquid FX pairs such as EURUSD and GBPUSD, and XAUUSD.
Inputs
| Group | Input | Default | Meaning |
|---|---|---|---|
| Symbol | InpSymbol / InpTF / InpHTF | "" / M15 / H1 | Symbol / entry timeframe / higher timeframe |
| Engines | InpUseA / InpUseB / InpUseC | true / true / true | Turn each engine on or off |
| Engines | InpATRPeriod / InpSL_ATR / InpRR | 14 / 1.5 / 2.0 | ATR period / stop = ATR x this / target = stop x this |
| Portfolio | InpMaxTotalRiskPct | 1.5 | Maximum open risk of all engines, % of balance |
| Portfolio | InpLockStartR / InpLockPct | 1.0 / 50 | Start the profit lock at this multiple of risk / % of the move to lock (0 = off) |
| Portfolio | InpFriCutHr | 18 | No new entries on Friday from this hour (25 = off) |
| News | InpNewsPause / InpNewsBeforeMin / InpNewsAfterMin | true / 30 / 30 | Pause around high-impact news (live only) |
| Risk | InpAutoTrade / InpRiskPct | true / 0.5 | Trading on/off / risk % per trade |
| Risk | InpMaxDailyLossPct / InpMaxTotalDDPct | 3.0 / 0 | Daily loss limit % / total drawdown floor % (0 = off) |
| Risk | InpMaxSpreadPts / InpMaxLot | 0 / 0 | Spread limit in points / lot cap (0 = off / broker max) |
| Risk | InpMagic / InpSlippage / InpShowPanel | 20261110 / 30 / true | Base magic (engines +1, +2, +3) / slippage / panel |
Risk disclaimer
Trading leveraged products such as forex, gold and CFDs carries a high level of risk and may not be suitable for all investors. You can lose more than your deposit. This EA does not guarantee profit, and past or backtested results do not indicate future results. Test on a demo account with your own broker's conditions before using real money, and only trade money you can afford to lose.
