Protecting a gold (XAUUSD) EA from spread spikes and slippage - what works for you?

Hello everyone,

Gold is one of the hardest symbols to automate because the spread and slippage can change a lot in a few seconds, especially at the daily rollover and around high-impact news.

These are the protections I use in my gold EAs at the moment:

1. Max spread in PRICE, not in points. 60 points means something different on brokers with 2 and 3 digits for XAUUSD, so I check (Ask - Bid) against a value like 0.60.
2. Rollover block: no new trades for a few minutes before and after the server day change.
3. Volatility spike filter: no entry if the current candle range is much bigger than the ATR.
4. Stop loss and take profit always sent with the order, never "virtual" only.
5. News filter using the MQL5 economic calendar (CalendarValueHistory).

Questions for other developers:
- Do you also measure the spread in price for gold, or do you use another method?
- How many minutes before and after high-impact news do you stop trading?
- Have you found a reliable way to handle slippage on market orders, for example checking the fill price and adjusting SL/TP after the order?

Interested to hear your experience.

Thank you.

I believe measuring spreads in actual price values is a more consistent approach, as it helps maintain predictable filtering across brokers with different quote digits.

Regarding news events, I consider temporarily suspending new entries around high-impact announcements a sensible risk-management measure. However, the appropriate time window should depend on the event's significance and the EA's trading strategy.

As for slippage, monitoring the actual execution price and verifying that Stop Loss and Take Profit levels are correctly applied after execution is essential. This helps ensure that the intended risk parameters are maintained even when market conditions change rapidly.