XAUUSD Adaptive Trend Signals (ATR Trail + EMA + ADX + HTF)

430
XAUUSD Adaptive Trend Signals is a trend-following indicator built only for spot gold (XAUUSD). It combines an ATR trailing stop with trend, trend-strength and higher-timeframe filters, then draws each trade's entry, stop loss, take profit and result directly on the chart.

HOW IT WORKS
1. Signal: an ATR trailing stop (the UT Bot style trail). A BUY appears when price closes above the trail, a SELL when it closes below.
2. Trend filter: BUY only above the 200 EMA, SELL only below it.
3. Strength filter: ADX must be above the minimum (default 20), which skips choppy, sideways markets.
4. Higher-timeframe filter: price must agree with a 50 EMA on a timeframe at least 4x the chart (picked automatically, e.g. 5m chart uses 30m, 1h uses 4h).
5. Risk: stop loss = 1.5 x ATR (with a minimum distance), take profit = 2 x the risk. Both scale with volatility, so the script adapts to any standard timeframe.

A trade closes at TP, at SL, or when the trail flips against it. If SL and TP are touched in the same candle, it is counted as a loss. Signals are calculated on closed candles only, so they do not repaint.

ON THE CHART
- BUY / SELL labels, entry (blue dashed), SL (red) and TP (green) lines
- Outcome labels: TP +2R, SL -1R or EXIT with the R result
- The last completed trades (default 10) plus the active trade stay visible
- A compact table: status, chart/HTF timeframe, wins/losses, win rate and net result in R

The table subtracts an adjustable spread cost from every trade (default 0.17), so the stats are closer to real trading conditions.

SYMBOL CHECK
The script only works on XAUUSD spot gold quoted in USD (broker suffixes such as XAUUSD.a or XAUUSDm are accepted). On any other symbol it shows "Not XAUUSD" and gives no signals. It shows WAIT when there is not enough history or higher-timeframe data, or on non-standard charts (Renko, Range, etc.).

NEWS OPTIONS (optional)
- Enter high-impact news times (UTC) in the settings to block new trades from 30 minutes before to 60 minutes after each event. Blocked periods are shaded yellow.
- Optional auto-block for the US jobs report (first Friday of the month).
- Optional pause after a volatility spike (a candle larger than 3x ATR).
- Optional exit of an open trade when a news window starts.
Pine Script cannot read live news, so event times must be entered manually.

ALERTS
BUY signal, SELL signal, TP hit, SL hit, and trend-flip/news exit. Create them from the alert menu by choosing this indicator.

SETTINGS
ATR length and multiplier, trend EMA length, ADX length and minimum, higher-timeframe filter on/off and EMA length, stop loss (x ATR), reward:risk, minimum stop in ticks, spread cost, news settings, number of trades kept on the chart, and table text size.

NOTES
- Results differ by timeframe and market conditions. Test on your own chart and timeframe before use.
- The table is a simple on-chart tracker, not a full backtest. It does not include slippage, commissions or swaps.
- This indicator is for educational and informational purposes only and is not financial advice. Past results do not guarantee future performance. Always use proper risk management.

The ATR trailing-stop logic is based on the widely used UT Bot concept.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。