Orion Gold Trend Breakout Expert
- Uzmanlar
- Jinglong Liu
- Sürüm: 0.8
- Etkinleştirmeler: 5
Daily-range breakout system for Gold and major Forex pairs. The Expert Advisor places pending stop orders at the prior-day high and low, then manages exits using volatility-scaled targets and a configurable hold-time ceiling.
Orion uses breakout logic with a hard Stop Loss on every trade. No grid. No martingale. No hedging. No anti-loss averaging. One position at a time. Each trade is independent.
Why this Expert Advisor
- Rule-based breakout logic with fully transparent inputs — no hidden parameter, no black-box model.
- Multi-symbol design: backtested on XAUUSD M15 (reference); EURUSD and GBPUSD also supported across M15 / H1 / M30 / D1 timeframes with parameter retuning.
- Built-in broker-compliance guards: pre-trade margin check, broker stops-level distance enforcement, and per-day signal de-duplication.
- Fixed lot per trade — predictable risk exposure, no martingale, no grid, no anti-loss averaging.
How it works
On every new trading day the EA reads the previous daily candle. After the configured setup hour it places two pending stop orders:
- Buy Stop above the prior-day high (entry = high + EntryBufferPoints).
- Sell Stop below the prior-day low (entry = low − EntryBufferPoints).
Stop-loss is sized from the prior-day range using StopRangeMultiplier . Take-profit is sized using TakeProfitRangeMultiplier . Positions that remain open beyond MaxHoldHours are time-exited. Pending orders that do not trigger are cancelled at the end of the day.
Before each pending order the EA verifies broker stop-level distance and free-margin headroom. If either constraint cannot be satisfied, the order for that day is skipped — by design — rather than forced into an invalid state.
Broker Compliance & Prop Firm Ready
Orion v0.7 includes explicit pre-trade validation that makes the EA compatible with strict broker conditions and prop-firm challenges (FTMO, MyFundedFX, FundedNext, and similar):
- Broker stops-level distance check ( SYMBOL_TRADE_STOPS_LEVEL ): every pending order verifies that entry, stop-loss and take-profit distances satisfy the broker's minimum-distance rule. Orders that would be rejected as "Invalid price" are skipped before submission.
- Pre-trade margin verification ( OrderCalcMargin ): the EA computes the required margin for each pending order and skips it if FreeMargin < 100 USD — a guard against forced rejection on low-balance evaluation accounts.
- Hard Stop Loss on every position: no recovery legs, no averaging-down. Maximum loss per trade is bounded by the SL distance × position size at entry.
- One position at a time: the EA does not stack positions or grid into a losing trade. If a setup is active, new entries are blocked.
These three guards together mean Orion does not violate the "Maximum Loss per Trade" or "Consistency Rule" used by most prop firms.
Setup checklist
- Broker: any ECN or low-spread broker offering XAUUSD with a readable SYMBOL_TRADE_STOPS_LEVEL . Raw-spread accounts preferred.
- Account size:
- Under $500: set Lots to 0.01 (default) and treat as a learning account. The EA may skip many setups due to margin guard.
- $500–$1,500: default parameters are calibrated for this range.
- $1,500+: you may increase Lots proportionally; check broker minimum-distance behaviour on XAUUSD with your chosen lot size.
- Prop-firm challenge accounts: use Fixed Lot mode (default), keep Lots = 0.01 for the first phase to stay well within Daily Loss and Maximum Loss limits.
- VPS: recommended for 24/7 operation with low broker latency. Breakout fills are time-sensitive.
- Supported symbols: XAUUSD (primary), EURUSD, GBPUSD. Other major pairs are likely compatible but have not been backtested.
- Reference timeframe: M15 (backtest reference). H1 / M30 / D1 are supported and may require parameter re-optimisation of StopRangeMultiplier / TakeProfitRangeMultiplier .
Parameters
| Parameter | Default | Description |
|---|---|---|
| Lots | 0.01 | Fixed position size per entry |
| MagicNumber | 20261134 | Order tag; change to isolate from other EAs |
| EntryBufferPoints | 30 | Distance above prior high / below prior low for the pending entry |
| StopRangeMultiplier | 0.08 | Stop-loss as fraction of the prior-day range |
| TakeProfitRangeMultiplier | 0.25 | Take-profit as fraction of the prior-day range |
| SetupHour | 0 | Server hour after which the EA may place daily orders |
| MaxHoldHours | 3.0 | Time-based exit threshold for open positions |
Backtest performance
One-year out-of-sample backtest on XAUUSD M15 history, period 2025-05-27 to 2026-05-22, modelled at every tick using broker reference data.
| Metric | Value |
|---|---|
| Symbol | XAUUSD (primary); EURUSD / GBPUSD also supported |
| Timeframe | M15 (backtest reference); H1 / M30 / D1 supported with parameter retuning |
| Backtest period | 2025-05-27 → 2026-05-22 (~12 months, out-of-sample) |
| Total trades | 194 |
| Profit factor | 1.43 |
| Expected payoff per trade | $2.34 |
| Recovery factor | 3.48 |
| Maximum equity drawdown | 1.28% ($130.46 absolute) |
| AHPR / GHPR per trade | 1.0002 (0.02%) |
| Sharpe ratio (per-trade) | 10.06 |
| Annualized risk-adjusted return (Calmar) | 3.13 |
About the Sharpe and Calmar numbers: MT5 Strategy Tester reports a per-trade Sharpe — the ratio of mean trade return over the standard deviation of trade returns. The per-trade Sharpe of 10.06 is high because the strategy uses a fixed Stop Loss and Take Profit envelope that keeps individual-trade dispersion small; it is not directly comparable to the annualized Sharpe used by hedge funds. As an honest annualized risk-adjusted return metric, we report the Calmar ratio of 3.13 (annualized return ÷ maximum drawdown), which is the industry standard for asymmetric-payoff strategies like breakouts. Profit Factor 1.43 and Recovery Factor 3.48 remain the most meaningful headline metrics for evaluating real-money expectancy.
See attached screenshots for the equity curve, full strategy tester report and trade-level breakdown.
What makes Orion different
Most gold EAs on the MQL5 Market fall into one of three patterns: stacked sub-strategies (6–10 indicators voted into a single signal), grid recovery (martingale or anti-martingale lot scaling), or black-box neural networks (advertised as "AI" with no transparent rule set). Orion takes a different route:
- One rule, fully written down. Previous day high/low breakout with a range-scaled stop. You can read the rule in this description. There is no second model.
- One position per setup, no recovery legs. Losses are bounded by the stop. Winners are capped at the take-profit. The EA does not add to losing trades.
- Broker compliance is a feature, not an afterthought. Most EAs assume the broker will accept whatever they send. Orion checks first — that's why it works on prop-firm challenges where other EAs fail validation.
- The backtest is a 12-month out-of-sample window (May 2025 → May 2026) capturing both the gold parabolic rally and subsequent range compression. Numbers reported are exactly what MT5 Strategy Tester produced — no curve smoothing, no selective reporting.
If you want a "click and forget" EA that promises 200% per month with no drawdown, Orion is not it. If you want a transparent rule set you can reason about, Orion is a starting point.
Update log
- 0.7 — Relaxed v0.6 margin guard so it only filters very low free margin (under 100 USD); broker server-side validation handles the rest. Resolves "no trading operations" rejection on normal account sizes.
- 0.6 — Treated OrderCalcMargin returning 0 as fail-closed (skip order) instead of bypass.
- 0.5 — Skip pending orders when free margin is insufficient (replaces non-functional lot-scaling in 0.4).
- 0.4 — Added free-margin pre-check via OrderCalcMargin .
- 0.3 — Added SYMBOL_TRADE_STOPS_LEVEL distance enforcement; skip orders that would violate broker stops level.
- 0.2 — Initial release.
Frequently asked questions
Can I try it on a demo account first?
Yes. A free demo period is included on MQL5 Market and the EA runs unchanged on both demo and real accounts.
Which timeframe should I use?
H1 is the reference. Other timeframes are supported but may benefit from re-optimisation of the multiplier inputs.
Does the EA require manual supervision?
No. Once attached to a chart it operates autonomously. Weekly drawdown review and quarterly parameter review are recommended.
Will it run on a 4-digit broker?
Yes. All price-distance parameters are scaled by _Point , so they adapt to 4-digit and 5-digit pricing automatically.
What if my broker has a high stops level?
The EA detects the broker stops level at runtime and skips the day's orders when distances cannot be satisfied. No invalid orders are submitted.
Is Orion safe for prop-firm challenges (FTMO, MyFundedFX, etc.)?
The broker compliance guards (stops-level check, margin pre-check, hard SL, single-position rule) keep Orion within the standard rule set used by major prop firms. Always confirm specific rules with your prop firm before deploying on a paid evaluation.
After download — please contact me
After downloading the demo or full version, send me a private message via MQL5. I'll share:
- The recommended set file for your broker's spread profile.
- A short note on which timeframe/symbol combination has been most stable in recent forward testing.
I read every message and respond within 24 hours.
If Orion runs well on your demo, I would really appreciate a review — it helps this project grow.
Disclaimer
Trading foreign exchange and CFD contracts on margin carries a substantial level of risk and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade these instruments you should carefully consider your investment objectives, level of experience and risk appetite. Past performance is not indicative of future results. The publisher of this Expert Advisor accepts no liability for any direct or indirect loss caused by use of the software. By installing and running this EA you confirm that you understand the risks of automated trading and accept full responsibility for the outcomes on your account.

