Downloads · 30 days
0
Bhushanz16/xauusd-trading-predictor
xauusd-trading-predictor is a machine learning model from Bhushanz16. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A machine learning model for predicting XAUUSD (Gold/USD) directional moves for swing trading with a 3-day prediction horizon.
Downloads · 30 days
0
Access
Public
Updated May 8, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.json809 KB · 94%
From the Hugging Face model README
A machine learning model for predicting XAUUSD (Gold/USD) directional moves for swing trading with a 3-day prediction horizon.
| Property | Value |
|---|---|
| Model Type | XGBoost Classifier |
| Task | Binary Classification (Up vs Down) |
| Prediction Horizon | 3 trading days |
| Lookback Window | 20 days |
| Data Period | 10 years (2016-2026) |
| Move Threshold | 0.3% minimum move |
| Confidence Threshold | 58% |
The model uses a multi-asset feature engineering pipeline that combines:
Features are flattened over a 20-day lookback window, creating ~2,340 input dimensions per sample.
| Metric | Value |
|---|---|
| Test Accuracy | 53.25% |
| Test AUC | 55.77% |
| Down Recall | 47% |
| Up Recall | 57% |
| Threshold | Trades | Win Rate | Total Return | Sharpe |
|---|---|---|---|---|
| 55% | High | Variable | Variable | Variable |
| 58% | Balanced | Best risk/reward | Optimized | Optimized |
| 60%+ | Low | High precision | Conservative | Conservative |
Benchmark (Buy & Hold during test period): +95.91%
pip install yfinance xgboost pandas numpy scikit-learn
from xauusd_inference import main
result = main()
# Returns: {'signal': '🟢 LONG (Buy)', 'prob_up': 0.62, ...}
python xauusd_inference.py
| Signal | Probability Range | Action |
|---|---|---|
| 🟢 LONG | Prob Up > 58% | Consider buying XAUUSD |
| 🔴 SHORT | Prob Up < 42% | Consider selling XAUUSD |
| 🟡 NEUTRAL | 42% ≤ Prob Up ≤ 58% | Wait for clearer signal |
All data fetched live from Yahoo Finance:
GC=F - Gold Futures (XAUUSD proxy)DX-Y.NYB - US Dollar IndexSI=F - Silver FuturesSPY - S&P 500 ETF⚠️ This model is for educational and research purposes only.
Financial markets are inherently unpredictable. Past performance does not guarantee future results. Trading financial instruments carries significant risk of loss. Always do your own research and consider consulting a financial advisor before making investment decisions.
| File | Description |
|---|---|
xauusd_trading_model.json | Trained XGBoost model |
xauusd_scaler.pkl | Feature scaler (StandardScaler) |
xauusd_feature_names.json | Feature name mapping |
xauusd_model_config.json | Model configuration |
xauusd_inference.py | Real-time inference pipeline |
xauusd_final_model.py | Training script |
This model is based on research in financial time series forecasting: