Why Gold is Different
Gold (XAUUSD) does not trade like a currency pair. It is a safe-haven asset, an inflation hedge, and a central bank reserve instrument all at once. This means technical analysis works differently on gold. Trends tend to be longer and stronger, mean reversion is less reliable, and volatility clusters around macroeconomic events rather than session opens.
The TickAtlas API tracks XAUUSD with the same real-time indicators available for forex pairs, making programmatic gold analysis straightforward.
Fetching Gold Data
import requests
API_KEY = "your_api_key_here"
BASE_URL = "https://tickatlas.com/v1"
HEADERS = {"X-API-Key": API_KEY}
def gold_analysis(timeframe: str = "H4") -> dict:
"""Fetch comprehensive gold indicators."""
resp = requests.get(f"{BASE_URL}/indicators", params={
"symbol": "XAUUSD",
"timeframe": timeframe,
}, headers=HEADERS)
return resp.json()["data"]
data = gold_analysis("H4")
print(f"Gold price: \${data['ohlcv']['close']:.2f}")
print(f"RSI: {data['indicators']['RSI_14']:.1f}")
print(f"ADX: {data['indicators']['ADX']:.1f}") API Response for XAUUSD
// GET /v1/indicators?symbol=XAUUSD&timeframe=H4
{
"success": true,
"data": {
"symbol": "XAUUSD",
"timeframe": "H4",
"ohlcv": {
"close": 2341.50
},
"indicators": {
"RSI_14": 62.4,
"MACD_main": 3.42,
"MACD_signal": 2.18,
"MACD_hist": 1.24,
"ATR_14": 12.35
},
"updated_at": 1787229614
}
} Best Indicators for Gold
SMA 50/200 (Trend Direction)
The golden cross (SMA 50 above SMA 200) and death cross are especially reliable on gold. Gold trends persist for months — the moving-average crossover catches these moves early.
ADX (Trend Strength)
Gold frequently enters strong trends (ADX > 30) driven by macro events. Use ADX to confirm whether to apply trend or range strategies.
ATR (Volatility / Position Sizing)
Gold ATR is measured in dollars, not pips. A typical H4 ATR of $12-15 means stop losses need to be wider than on forex pairs. Essential for position sizing.
RSI (Timing)
RSI works on gold but the thresholds should be adjusted. Gold can stay overbought longer than forex — use 75/25 instead of the standard 70/30.
Gold Trend-Following Strategy
def gold_trend_strategy() -> dict:
"""Trend-following strategy optimized for XAUUSD."""
data = gold_analysis("H4")
ind = data["indicators"]
price = data["ohlcv"]["close"]
sma_50 = ind["SMA_50"]
sma_200 = ind["SMA_200"]
adx = ind["ADX"]
rsi = ind["RSI_14"]
macd_hist = ind["MACD_hist"]
atr = ind["ATR_14"]
signal = "HOLD"
reasons = []
# Trend direction: moving-average crossover
if sma_50 > sma_200:
reasons.append("Bullish: SMA 50 above SMA 200")
if adx > 25 and rsi < 75 and macd_hist > 0:
signal = "BUY"
reasons.append(f"Entry: ADX {adx:.1f}, RSI {rsi:.1f}, MACD bullish")
elif sma_50 < sma_200:
reasons.append("Bearish: SMA 50 below SMA 200")
if adx > 25 and rsi > 25 and macd_hist < 0:
signal = "SELL"
reasons.append(f"Entry: ADX {adx:.1f}, RSI {rsi:.1f}, MACD bearish")
# Risk management
stop_distance = atr * 2
take_profit = atr * 3
return {
"signal": signal,
"price": price,
"stop_loss": price - stop_distance if signal == "BUY" else price + stop_distance,
"take_profit": price + take_profit if signal == "BUY" else price - take_profit,
"atr": atr,
"reasons": reasons
}
result = gold_trend_strategy()
print(f"Signal: {result['signal']}")
print(f"Price: \${result['price']:.2f}")
if result["signal"] != "HOLD":
print(f"Stop: \${result['stop_loss']:.2f}")
print(f"Target: \${result['take_profit']:.2f}")
for r in result["reasons"]:
print(f" - {r}") Gold-Specific Considerations
Wider Stops Required
Gold moves $10-20 on H4 regularly. A 2x ATR stop on gold might be $25, compared to 20 pips on EURUSD. Adjust position sizes accordingly.
Correlated with USD Strength
Gold often moves inversely to the US Dollar. Cross-reference with DXY or USDCHF before taking gold trades.
News Sensitivity
Gold reacts strongly to Fed decisions, CPI data, and geopolitical events. Check the economic calendar before entering gold positions.
Further Reading
Run this against live data.
Every account starts pay-as-you-go with $2.50 of credit and no card. Paste the key into the samples above and the requests work unchanged.