Gold Bias AI
- エキスパート
- バージョン: 1.23
- アクティベーション: 5
GoldBiasAI - Multi-Timeframe Bias EA for XAUUSD
SHORT DESCRIPTION
Seven timeframes must agree before gold gets your capital. A bias + RSI-timing expert advisor for XAUUSD M5 with fixed stops, no grid and no martingale.
FULL DESCRIPTION
GoldBiasAI is a fully automated MetaTrader 5 expert advisor built for one symbol: XAUUSD (gold) on the M5 timeframe. It combines a seven-timeframe trend bias with an RSI pullback trigger, and manages every position with a hard stop loss, a fixed target and a trailing stop.
HOW IT WORKS
1. BIAS
On every bar the EA compares a 20 EMA against a 50 EMA on M1, M5, M15, M30, H1, H4 and D1. Each timeframe votes long, short or neutral. A trade is only considered when at least 4 of the 7 timeframes agree on the same direction. When the market is split, the EA stays out.
2. ENTRY
On M5 the EA waits for RSI(14) to unwind into the bias: below 30 for longs, above 70 for shorts. One signal per bar with a 1-bar cooldown, so the EA does not chase a candle that has already run.
3. RISK PER TRADE
Every order goes out with a hard SL and TP (40.00 / 25.00 USD by default) plus a trailing stop that starts after 16.00 USD of profit and follows at 16.00 USD. There is no grid, no averaging down, no martingale and no hidden position.
4. POSITION MANAGEMENT
Maximum 2 open positions. Optionally closes the opposite side when a new signal appears. Trading window 15:00-11:00 server time, Friday close before the weekend, spread filter at 150 points and a 2% daily loss limit that stops new entries after the day's realized loss reaches the limit.
ON-CHART DASHBOARD
A panel shows balance, equity, floating P/L, current spread, magic number, open positions, server time and the live bias score per timeframe. Positions are also logged to gold_bias_entries.csv in MQL5/Files (time, direction, price, SL, TP, lot, bias, RSI, ATR, spread, hour) so you can audit every entry.
DEFAULT CONFIGURATION (v1.24)
Risk mode ............ RISK_FIXED_LOT
Fixed volume ......... 0.10 lot
Stop loss ............ 40.00 USD (fixed)
Take profit .......... 25.00 USD (fixed)
Trailing stop ........ ON, from 16.00 USD, distance 16.00 USD
Max positions ........ 2
Daily loss limit ..... 2% of balance
Entry ................ RSI reversal, period 14, 30 / 70
Bias ................. EMA 20/50, minimum score 4 of 7
ATR stops ............ OFF (optional switch)
Regime gate .......... OFF (optional switch)
Capital brake ........ OFF (optional switch)
The defaults above are exactly the configuration used in the backtest below. ATR-based stops, the ADX/ATR regime gate and the loss-streak / peak-drawdown brake are included in the same file as optional switches (InpUseATRStops, InpUseRegimeGate, InpUseBrake). Turn them on if you prefer a more defensive profile, but expect a different trade set from the one shown here.
BACKTEST
Symbol ................ XAUUSD
Timeframe ............. M5
Period ................ January 2022 - January 2026
Deposit ............... $3,000
Volume ................ 0.10 lot fixed
Modelling ............. every tick based on real ticks
Broker ................ HF Markets (HFMarketsGlobal-Demo4), commission and swap included
Net profit ............ +$3,544.39 (+118.1%)
Profit factor ......... 1.70
Win rate .............. 72.7% (56 wins of 77 trades, 66 long / 11 short)
Average trade ......... +$46.03
Max equity drawdown ... 28.46%
Max balance drawdown .. 13.3%
IMPORTANT RISK NOTE
These results use 0.10 lot fixed on a $3,000 account. On XAUUSD, 0.10 lot is about $10 per $1 move, and a 40.00 stop is about $400 of risk - roughly 13.3% of the starting balance. That is an aggressive setting: three or four losses in a row can take a large part of the account. If that is not what you want, set InpRiskMode to RISK_PERCENT (1% per trade) or RISK_BALANCE_STEP (0.01 lot per $300) and the EA sizes positions automatically, including the broker's minimum lot. Test on a demo account before using real money.
RECOMMENDED SETUP
- A broker with a tight gold spread (ECN / raw account preferred) and a VPS with low latency.
- XAUUSD quoted with 2 digits and a stop level of 0, or as close to 0 as possible.
- One XAUUSD M5 chart, automated trading enabled, no other EA using the same magic number (222).
- A deposit that makes 0.10 lot reasonable, or a lower fixed lot / percentage risk mode.
DESIGNED LIMITS
- One symbol (XAUUSD), one timeframe (M5). It is not a multi-pair system.
- Not a scalper: 77 trades in four years, average holding time measured in hours to days.
- Because the bias must agree across timeframes, long quiet periods without trades are normal.
CHOOSING YOUR LOT MODE
You are not locked into the backtest volume. GoldBiasAI has three position-sizing modes, selected with InpRiskMode in the "Risk" input group. Only the inputs that belong to the active mode are read; the others are ignored.
1) RISK_FIXED_LOT - fixed volume
Every trade uses InpFixedLot, regardless of the account balance. Simple and predictable: the dollar risk per trade stays the same, while the risk in percent of the account grows when the account shrinks and falls when it grows. This is the mode used for the backtest. On XAUUSD, 0.10 lot is about $10 per $1 move, so a 40.00 stop is about $400 per trade.
2) RISK_PERCENT - percentage of balance
The lot is calculated from InpRiskPercent and the real stop distance, so that a stop-out costs that percentage of the current balance. Example: 1% of $3,000 is $30. With a 40.00 stop on XAUUSD that works out to 0.0075 lot, and because the broker minimum is 0.01, the EA sends 0.01 lot. To trade 0.10 lot at 1% risk with a 40.00 stop you would need about $40,000 of balance. In practice: below roughly $4,000 the 0.01 minimum lot already risks more than 1% on a 40.00 stop, so percentage mode simply trades the minimum there. Above that, the lot scales with the account, up and down.
3) RISK_BALANCE_STEP - lot per balance step
Every InpBalanceStep of balance adds InpLotPerStep lots. With the shipped values (300 / 0.01): $900 balances 0.03 lot, $3,000 trades 0.10 lot, $6,000 trades 0.20 lot. The size moves in fixed steps and never goes below the broker minimum.
Which one to use
- Want the exact results shown below, bankroll style: RISK_FIXED_LOT at 0.10 (default).
- Want risk to follow your capital automatically: RISK_PERCENT at 1% or less, and a deposit large enough that the calculated lot is above 0.01.
- Want a simple "more balance, more size" rule: RISK_BALANCE_STEP with 300 / 0.01.
You can switch modes at any time; the EA applies the new sizing to the next signal only and never changes the volume of an open position. All lot sizes are rounded to the broker's volume step and clamped between its minimum and maximum.
No DLL and no external web requests. Runs on a standard MetaTrader 5 installation.
Version 1.24
