Gold Morning Short
- Experts
-
Augusto Martin D'anna
MQL5 & Pine Script developer | Trader since 2019 | Strategy validation
As a trader, I know a bot is only as good as the logic behind it. I bridge
trading concepts and clean code: I don't just follow instructions, I make
sure your EA behaves exactly the way your strategy intends. - Version: 1.0
- Activations: 5
Gold Morning Short sells XAUUSD on M30 during the New York morning when the 4-hour trend is down. It is a simple, fully rule-based EA: one trade per day at most, a hard stop loss on every trade, no grid, no martingale, no averaging and no positions held overnight.
Rules
- Trend filter: the close of the last finished 4-hour bar is below the TEMA(200) of 4-hour closes. The EA builds its own 4-hour bars on a fixed UTC grid (00:00, 04:00, 08:00...), so the signal does not depend on your broker's server time zone.
- Entry: sell at market at the close of an M30 bar that opens between 07:00 and 10:30 New York time, Tuesday to Friday. One trade per day.
- Stop loss: 2.67 x ATR(7) of M30. Take profit: 2 x the stop distance (2R).
- Management: at +0.5R it closes 50% of the position and moves the stop to the entry price.
- Time exits: closes after 8 hours at most, and always by 16:55 New York time.
How it was tested
Backtest on 1-minute data from 2015 to November 2026, with spread, commission and slippage of a typical prop-firm CFD account. The rules were found on 2015-2021, checked on 2022-2023, and then run once on 2024-2026 data that had not been used before. Results in R (1 R = the amount risked on one trade):
- 2015-2021: 680 trades, +70.3 R, +0.103 R per trade
- 2022-2023: 223 trades, +26.2 R, +0.117 R per trade
- 2024-2026 (out of sample): 295 trades, +17.3 R, +0.059 R per trade. 2024 lost 4.9 R.
- Largest drawdown 2015-2026: 14.2 R. Losing years: 2019 and 2024.
The last period is clearly weaker than the earlier ones, and small changes in how the 4-hour bars are drawn can move the 2024-2026 result between about 0 R and +17 R. Treat it as a modest edge that may already be fading, not as a money machine. The MT5 Strategy Tester on MetaQuotes data (June 2025 - November 2026) matched 133 of 143 entries of the original backtest.
Inputs
- Position size: % of balance risked per trade (default 0.5%) or fixed lot, maximum lot
- Broker server clock: New York + 7 (most brokers), Central Europe, UTC, or automatic (live only)
- Maximum spread filter (off by default), magic number, order comment
- Strategy values (window, TEMA, ATR, stop, target, partial close, time exits): the tested values are the defaults
Notes
- Run it on an XAUUSD M30 chart. Set the server clock input to match your broker, or the trading window will be shifted. If you are not sure, ask your broker what time its server shows at 17:00 New York.
- Test it first on a demo account or in the Strategy Tester with your broker's data and costs.
- It only trades sells. In a strong gold rally it can stay flat for weeks because the trend filter blocks the entries.
- It does not use DLLs or external connections.
Trading involves a risk of losing money. Past results do not guarantee future results.
