Gold Regime Day Trader
- Experts
-
Thunyapot Tharathipphayakun
MQL5 developer and XAUUSD trader based in Thailand.
I build Expert Advisors and indicators for MetaTrader 5, with a focus on intraday systems for Gold (XAUUSD) and EURUSD. My own EA, Gold Regime Day Trader, is published on the MQL5 Market.
What I can build for you: - Version: 4.0
- Activations: 5
Gold Regime Day Trader is an intraday Expert Advisor for XAUUSD. Each morning it reads the daily trend state and chooses one entry plan for the day. Every trade has a hard stop loss and all positions are closed before the daily rollover.
No grid. No martingale. No averaging down. No overnight positions.
How it works
The regime is taken from yesterday's closed D1 bar, compared with EMA 10 and EMA 100:
UP (close above both EMAs)
- Rule A: buy at the start of the session (01:00 server time).
- Rule A2: one additional buy if an M15 bar closes above the Asian range high between 07:00 and 13:00.
DOWN (close below both EMAs)
- Rule D2: sell only after an M15 bar closes below the Asian range low between 07:00 and 13:00. The EA does not sell blindly at the open, because gold downtrends tend to be choppy.
MIXED (EMAs disagree)
- Rule E: at 14:30 follow the direction of the first New York hour (14:30 price vs 13:30 open).
Optional Rule R (off by default): an RSI(2) pullback entry with an EMA 200 filter on M15, active in all regimes.
Each rule can open at most one trade per day. Stop loss is a multiple of the daily ATR. There is no fixed take profit: trades are closed at 20:45 server time.
Recommendations
- Symbol: XAUUSD (designed and tested on gold)
- Chart: M15 (the EA reads M15 and D1 data itself)
- Account: any type (hedging or netting), low-spread account recommended
- Server time: the default hours assume a broker on GMT+0. If your broker uses another time zone, shift all hour inputs by the difference.
- Risk: 0.5% to 1% per trade. On UP days two trades can be open at the same time.
- Minimum balance: about 1,000 USD for gold so that position sizing is not forced to the minimum lot. Smaller accounts can trade, but real risk per trade may be higher than the setting.
- VPS recommended, as the EA must be running at the entry times.
What to expect
- The strategy performs best in trending gold markets. In the backtest, 2020 to 2023 (a mostly sideways period) was close to flat, and most of the gains came in 2024 and 2025.
- Losing streaks of 10 or more trades have occurred in testing.
- Backtest results do not guarantee future results. Please test the EA in the Strategy Tester with your broker's data before using it on a live account.
Input parameters
Regime filter (D1)
- FastEMA / SlowEMA: periods of the daily EMAs used to classify the regime (10 / 100).
- ATRPeriod: daily ATR period used for stop loss distance (14).
Rule A / A2 (UP regime)
- UseRuleA, UseRuleA2: enable or disable each rule.
- A_Hour, A_Minute: entry time of Rule A (server time).
- A_SL_ATR, A2_SL_ATR: stop loss as a multiple of daily ATR.
Rule D2 (DOWN regime)
- UseRuleD2: enable or disable the rule.
- AsiaEndHour: end of the Asian range (range = 00:00 to this hour).
- D2_StartHour, D2_EndHour: time window for the breakdown entry.
- D2_SL_ATR: stop loss as a multiple of daily ATR.
Rule E (MIXED regime)
- UseRuleE: enable or disable the rule.
- E_RefHour, E_RefMinute: reference open of the New York hour.
- E_Hour, E_Minute: decision and entry time.
- E_SL_ATR: stop loss as a multiple of daily ATR.
Rule R (optional)
- UseRuleR: enable the RSI(2) pullback rule (off by default).
- R_RSIPeriod, R_Low, R_High: RSI settings.
- R_EMAPeriod: M15 EMA trend filter.
- R_StartHour, R_EndHour: trading window.
- R_SL_ATR: stop loss as a multiple of daily ATR.
Exit and risk
- ExitHour, ExitMinute: time when all positions are closed (20:45).
- RiskPercent: risk per trade in % of balance (0 = use FixedLot).
- FixedLot: fixed volume when RiskPercent is 0.
- UseMinLotIfSmall: if the calculated volume is below the minimum lot, trade the minimum lot as long as its risk does not exceed MaxRiskPercent.
- MaxRiskPercent: hard cap on risk per trade when the minimum lot is used.
- MaxSpreadPoints: skip entries when the spread is wider than this.
- Magic: base magic number (rules use Magic+0 to Magic+4).
- TradeComment: comment added to orders.
