Apex Trends

APEX TRENDS MT5 is a trend-following Expert Advisor that trades a small portfolio of markets from one account: gold (XAUUSD) and crypto (BTCUSD, ETHUSD), with a configurable instrument list. It trades both directions — long in uptrends, short in downtrends — and filters its own entries by market regime.

The EA does not use grid, martingale, averaging, or hedging. Every trade is independent, protected by a stop-loss from entry, and followed by an ATR-based trailing stop.

The strategy is built on a Donchian channel breakout, confirmed by an EMA trend filter, ADX strength, and +DI / −DI direction, and gated by a higher-timeframe (D1) regime filter. This is a selective approach: the EA does not trade constantly — it waits for the right conditions and enters only when all filters align.

Strategy Logic

  • Entry — long (mirror for short):
    • Breakout of the Donchian channel (20 bars, shifted by 1).
    • EMA(20) > EMA(50) and price > EMA(200).
    • ADX(14) ≥ 20 and +DI > −DI (for shorts: −DI > +DI).
    • D1 regime filter: daily EMA(200) rising with ADX(14) ≥ 25 (short side mirrored).
  • Position management:
    • Stop-loss: 2 × ATR(14) from entry price.
    • Trailing: 4 × ATR from the highest close since entry (updated on the close of a new bar).
    • EMA exit: close below EMA(20) on reversal.
    • Stops-level aware and market-session aware (no modify/close attempts when the market is closed or at rollover).

Portfolio Risk Management

  • Hard portfolio ceiling — the sum of open risk across all legs cannot exceed  InpPortfolioRiskMax  (the "1% × 3 = 3%" case is no longer possible). Effectively a cap on the number of simultaneous 1%-risk legs (2.0 ≈ two legs).
  • Correlation adjustment — an optional extra weight for the BTC/ETH pair ( InpCorrBTCETH ). On the tested history (2015–2026) BTC and ETH were never open simultaneously at an entry, so this branch never fired: it ships as dormant insurance, unverified, not as a proven feature.
  • Account drawdown guard — new entries pause at  InpMaxDDPercent . This is a safety net, not a performance knob (it did not trigger at the default 25% on the tested history). A time re-arm ( InpDdRearmHours ) automatically clears the halt so it cannot dead-lock.
  • Observability — gate, halt and re-arm events are logged ( InpLogRiskSkips ), so the mechanism is visible in the journal instead of assumed.
  • Risk is measured correctly: distance-to-stop × tick value × volume (not margin).

Risk Management (per trade)

  • Fixed risk per trade — 1% of equity by default; lot size from the stop distance (2 × ATR).
  • Free margin / market-mode check before every entry.
  • Symbol aliases resolved automatically (XAUUSD/GOLD, BTCUSD/BITCOIN, ETHUSD/ETHEREUM and common suffixes); missing instruments are skipped silently.
  • Drawdown peak is persisted across terminal restarts (live), so the halt logic survives a VPS reboot.

Portfolio by design

  • One account, multiple uncorrelated legs. Correlation of gold to crypto is close to zero, which raises risk-adjusted return versus a single instrument.
  • Only trending, low-correlation instruments should be added; ranging markets (most FX, index shorts) dilute performance.

Backtest Results Portfolio XAUUSD+BTCUSD, H4, long+short, D1 filter, risk 1%, deposit 10 000, model "1 minute OHLC":

  • 2015–2026: Net ≈ +442%, Profit Factor ≈ 1.9, Sharpe ≈ 2.2, Max Drawdown ≈ 12.6%.
  • Out-of-sample 2021–2026: Sharpe ≈ 1.7, Profit Factor ≈ 1.7.
  • Walk-forward: 6 of 6 two-year windows positive.
  • Monte-Carlo: actual drawdown within the simulated band (not in the worst 5%).
  • Regime stress: gold flat (2015–2017) +; crypto crash (2018) +; choppy 2022 ≈ breakeven.
  • Portfolio ceiling (cap 2%): within noise of the un-limited run (+906 net over 11 years, 2 trades) — it did not worsen performance and added a hard ceiling. A tighter cap (1%) cut drawdown to ~9.7% but also reduced net/Sharpe and is not validated out-of-sample. Caps are chosen by drawdown tolerance, not by Sharpe.
  • Per-leg (single instrument, H4, D1 filter): XAUUSD PF ≈ 1.6; BTCUSD PF ≈ 2.1; ETHUSD PF ≈ 1.5. Past performance does not guarantee future results. Drawdowns are inevitable. Plan your risk accordingly.

Operating modes

  • Recommended: H4 — fewer trades, lower drawdown. H1 is possible but more aggressive.
  • Run the default portfolio (XAUUSD,BTCUSD,ETHUSD) if your broker offers crypto; otherwise set the list to the instruments you have (e.g., XAUUSD).

Performance

  • Heavy indicator work runs once per closed bar; entry retries are throttled. Real-tick backtests of the portfolio complete in minutes, not hours.

Important notes (live vs backtest)

  • The trailing stop updates on the close of a new bar (not intrabar). On H4 it can lag by up to ~4 hours.
  • The EA runs on OnTick of the CHART symbol. If the chart symbol is closed (e.g. gold on weekends) there are no ticks, so crypto legs open over the weekend are not managed until Monday. Attach the EA to a symbol that trades when you need management, or accept this gap.
  • Portfolio risk per leg is measured as (entry → current stop) × value; a leg whose stop has trailed above entry counts as zero risk. Once all legs are protected, the entry ceiling stops blocking (intentional).
  • On small accounts the minimum lot can force risk above the target; this is logged ("lots clamped to min").

Technical Details

  • Platform: MetaTrader 5
  • Instruments: XAUUSD, BTCUSD, ETHUSD (configurable)
  • Timeframes: H4 (recommended), H1
  • Minimum deposit: 1 000 USD (at 1% risk; more for full portfolio)
  • Leverage: 1:100 recommended
  • Broker: low-spread / ECN / RAW
  • VPS: recommended (ping < 50 ms)
  • Self-contained: no DLLs, no external files, one .mq5 file

Not Used: martingale, grid, averaging, hedging.

Input Parameters

  • InpSymbols — portfolio instrument list (e.g., XAUUSD,BTCUSD,ETHUSD).
  • InpRiskPercent — risk per trade, % of equity (1.0).
  • InpAllowShorts — allow short trades (true).
  • InpUseRegimeFilter — enable D1 regime filter (true).
  • InpRegimeAdxMin — minimum D1 trend strength to enter (25).
  • InpBreakoutN — Donchian breakout lookback (20).
  • InpEmaFast — fast EMA (20).
  • InpEmaSlow — medium EMA (50).
  • InpEmaTrend — trend EMA (200).
  • InpEmaExit — EMA used for exit (20).
  • InpAtrPeriod — ATR period (14).
  • InpAdxPeriod — ADX period (14).
  • InpAdxMin — minimum ADX on the working TF (20).
  • InpSlATR — stop-loss size in ATR (2.0).
  • InpTrailATR — trailing-stop size in ATR (4.0).
  • InpMaxDDPercent — drawdown halt threshold, % (25). Safety net, not a Sharpe knob — change only after a new walk-forward.
  • InpDdRearmHours — hours to auto-clear the halt (168 = 1 week). Dormant at the default cap; change only together with the cap.
  • InpMaxSpreadPts — max spread in points to enter (0 = off).
  • InpRiskMode — 0 = off, 1 = hard cap, 2 = correlation-adjusted (2).
  • InpPortfolioRiskMax — max total open risk, % (2.0 ≈ two 1%-legs).
  • InpCorrBTCETH — correlation weight for BTC/ETH (0.7). Dormant/unverified on tested data.
  • InpLogRiskSkips — log gate/halt/re-arm events (true).
  • InpSkipRollover — skip entries at rollover hour (true).
  • InpRolloverHour — rollover hour, server time (23).
  • InpMagic — trade identifier (6041).
  • InpSlippage — allowed slippage in points (30).

Recommendations Before You Start: test on demo ≥ 3 months; start at 0.5% risk; move to 1% only after stable results; use a VPS; do not change parameters without a new walk-forward; always load the supplied .set file (the MT5 tester retains previous inputs between runs).

Support: via the built-in MQL5 chat.

Disclaimer: Trading gold, crypto and CFDs involves significant risk and may not be suitable for every investor. Past results do not guarantee future results, and losses are possible. Results may vary between brokers and accounts due to differences in execution, spreads, slippage, liquidity, and technical infrastructure. The portfolio risk ceiling, correlation weight and drawdown halt are risk-control mechanisms; on the tested history the correlation branch and the default drawdown halt did not trigger, so their benefit is not proven and their live behaviour may differ. No system can fully eliminate trading risk or guarantee identical results. The EA is selective by nature: in some periods there may be few trades or none at all. Testing on a demo account is strongly recommended before using real funds.


作者のその他のプロダクト
Event Horizon Trader   is a cutting-edge automated trading robot built on an innovative hybrid architecture. It combines quantum principles, artificial intelligence, and a multi-level risk management system for adaptive trading on financial markets. The expert advisor is designed to operate in volatile market conditions, dynamically adapting to trending, ranging (flat), and highly volatile periods. The advisor has a test configuration for the pair: XAUUSD. Key System Components: Quantum System Q
FREE
Imagine a professional system that patiently weaves its web on the currency market, waiting for the perfect moment to strike. Stochastic SpiderNet is an intelligent trading robot (expert advisor) for the MetaTrader 5 platform, created for traders who understand the power of grid trading but want to secure it with powerful protection algorithms. This is not just a "grid trader." It is a symbiosis of the classic Stochastic oscillator and an adaptive grid controlled by artificial constraints. How
FREE
AurumAI
Vladimir Novikov
AurumAI   is a fully automated trading expert for XAUUSD (gold) on the H4 timeframe. At its core lies an ensemble of machine learning models (LightGBM, XGBoost, CatBoost) combined into a single stack via ONNX. The models analyze 21 features, including classic indicators and M1 microstructure data, to produce probability estimates for three time horizons. A trade signal is generated when the z‑score of the current probability exceeds a threshold, with the z‑score computed on a rolling window to
FREE
MultiStrategy GOLD - Smart Advisor for Gold Trading ADVANTAGES 4 Strategies in One Instead of one vulnerable strategy, there are four independent approaches working simultaneously: Swing Strategy — catches market reversals Fractal Strategy — precise entries at key levels Trend Strategy — follows the trend Breakout Strategy — captures impulsive movements ️ Capital Protection Automatic lot calculation — never risk more than the set percentage Stop-loss in every trade — protection aga
FREE
Safe Adaptive Trader PRO v7.3 AI Enhanced   Key Advantages Safe Adaptive Trader PRO v7.3 AI Enhanced is a new-generation professional trading system that combines classical technical analysis with an advanced AI Quantum module. The system uses a neural network model with adaptive learning, multi-level capital protection, and automatic adjustment to any market conditions. It is designed to work with any symbols (Forex, metals, indices, cryptocurrencies), but is optimally configured for
FREE
Quantix
Vladimir Novikov
Quantix – A New Generation AI Trading Robot Quantix is an intelligent automated trading system designed for the foreign exchange and precious metals markets, demonstrating strong results (XAUUSD). At its core, the robot utilizes an adaptive algorithm that continuously learns from market data, combines signals from multiple indicators, and applies strict risk filters. It shows consistent deposit growth with moderate drawdown, indicating the reliability and effectiveness of its strategy.   How
FREE
RegimeMaster FX: интеллектуальный советник для MetaTrader 5 RegimeMaster FX   – это автоматическая торговая система нового поколения, которая не просто следует за рынком, а адаптируется к его состоянию. Вместо жёстких правил советник использует динамическую комбинацию индикаторов, нелинейную обработку сигналов и самообучающийся механизм распределения весов между модулями. Это позволяет системе оставаться гибкой как в трендовые периоды, так и во флэте. Как это работает Анализ рыночного режима
FREE
Quantropy   is a hybrid trading system that combines a powerful manual control panel and an intelligent, AI-powered Expert Advisor. You retain full control, while the AI assists with signals, manages risks, and automates routine tasks. It is suitable for manual trading, automatic trading, or a combination of both. 1. Manual Panel – Full Control Over Every Trade The manual panel contains all the necessary tools for quick and safe market entry. 1.1. Price Input and Visualization The Open, SL, TP f
FREE
Gate Keeper Gold is a trend-following Expert Advisor for XAUUSD (Gold) , built for traders who value discipline , transparency , and fixed risk over promises. The EA does not use grid, martingale, averaging, or hedging. Every trade is managed independently , protected by a stop-loss from the moment of entry , and followed by an ATR-based trailing stop . The strategy is built on a Donchian channel breakout , confirmed by an EMA trend filter , ADX strength , and +DI / −DI direction . This is a se
フィルタ:
レビューなし
レビューに返信