Multi-layer directional filter for XAUUSD — design pattern feedback (EMA + RSI vs ADX)

 



Hi all,

Working on a directional filter for a systematic XAUUSD strategy. Need feedback from devs who've built trend-filter logic, not on my system architecture.

Setup of the filter:

I want to refuse entries when the price is in a clearly opposite trend context — but not be so strict that I miss genuine pullback/breakout opportunities. Soft filter, not aggressive.

What I've found via data analysis on 4+ years XAUUSD H1:

  • Out of ~10 standard features tested (EMA50/200 slope, close-vs-EMA, RSI14, ADX14, ATR, range%, etc.) the most discriminating are:
    1. RSI14
    2. EMA50 slope (5-bar delta)
    3. close vs EMA50 distance
  • ADX14 scored lowest in feature importance — counterintuitive given how often ADX is recommended as a trend strength filter. Curious if others have seen this on gold specifically.
  • Logistic regression OOS (train 2022-2024 / test 2025-2026) holds AUC > 0.62 on sell-side filter but buy-side filters overfit (AUC drops to 0.50-0.55 on test). Could be 2022-2026 gold bull market biasing the signal.

Current rule (sell-side block only):

block_sell IF close > EMA50 * (1 + 0.0005) AND ema50_slope_5bar > 0 AND RSI14 > 55

AND-gated: blocks only when ALL THREE clearly bullish (= worst-case counter-trend sell).

Questions for the experienced:

  1. AND vs OR vs weighted score — when stacking 3+ conditions in a directional filter, do you prefer hard AND-gating (mine), OR-gating, or a weighted score with threshold? Pros/cons?

  2. Threshold setting without curve-fit — I picked 0.05% EMA buffer + RSI 55 from data means. Better practice: ATR-relative thresholds? Z-score thresholds? Hard fixed?

  3. Why does ADX rank so low on gold? Is gold's volatility regime fundamentally different (frequent regime shifts, news spikes) that makes ADX noisy?

  4. Asymmetric directional filters — buy-side filter failing OOS while sell-side holds: known pattern in trending markets, or signal of overfit on the working side?

  5. Multi-TF confirmation — would you add H4 or D1 EMA alignment as a higher gate (filter only fires if both H1 AND H4 EMA agree)? Risk of over-filtering vs robustness gain?

  6. XAU-specific — anything quirky about gold's intraday/session regimes that should be in the filter (e.g., Asian range, NY break, FOMC blackout)?

Pure design discussion — happy to share findings once tuned.

Thanks!


Best ,  Tony