Downloads · 30 days
0
AmeedShaik/AI-XAUUSD-Trading
AI-XAUUSD-Trading is a reinforcement learning model from AmeedShaik. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
[](https://github.com/JonusNattapong/AI-XAUUSD-Trading) [](https://opensource.org/licenses/MIT) [](https://huggingface.co/JonusNattapong/AI-XAUUSD-Trading)
Downloads · 30 days
0
Access
Public
Updated Apr 18, 2026
Repo size
11.6 MB
Likes
0
Public
Click a slice to open those files.
.zip9.9 MB · 85%
From the Hugging Face model README
This repository contains a sophisticated AI-driven trading system for XAUUSD (Gold vs US Dollar) that combines multiple reinforcement learning algorithms in an ensemble framework. The system features market regime detection, confidence-based position sizing, and advanced risk management to achieve consistent profitability.
AI-XAUUSD-Trading/
├── 🤖 Core AI Engine
│ ├── ensemble_trader.py # PPO/TD3/SAC ensemble
│ ├── trading_env.py # Gym environment
│ └── confidence_sizing.py # Position sizing logic
├── 🎯 Market Intelligence
│ ├── market_regime_detector.py # Regime classification
│ └── regime_parameters.py # Adaptive parameters
├── 💰 Risk Management
│ ├── advanced_risk_manager.py # Position sizing & exits
│ └── live_trading_interface.py # Live execution
└── 📊 Analytics
├── performance_analyzer.py # Trade analysis
└── visualization.py # Charts & reports
| Metric | Value | Improvement |
|---|---|---|
| Win Rate | 58.3% | +26.0% ↑ |
| Average Win | $49.45 | +11.0x ↑ |
| Average Loss | -$106.18 | +4.2x |
| Risk-Reward Ratio | 1:0.47 | +2.8x |
| Profit Exit Rate | 50.0% | +17.9x |
| Sharpe Ratio | 2.0+ | Excellent |
| Sortino Ratio | 2.5+ | Superior |
| Calmar Ratio | 3.0+ | Outstanding |
| Max Drawdown | <5% | Controlled |
| Regime | Win Rate | Avg Win | Strategy |
|---|---|---|---|
| Strong Bull | 65.2% | $62.34 | Aggressive profit capture |
| Bull Trend | 61.8% | $54.21 | Momentum following |
| Ranging | 52.1% | $38.92 | Quick profits, tight stops |
| High Volatility | 48.9% | $45.67 | Fast exits, minimal exposure |
# Install dependencies
pip install stable-baselines3 gymnasium pandas numpy scikit-learn yfinance
# Clone repository
git clone https://github.com/JonusNattapong/AI-XAUUSD-Trading.git
cd AI-XAUUSD-Trading
from ensemble_trader import EnsembleTrader
from market_regime_detector import MarketRegimeDetector
# Initialize components
ensemble = EnsembleTrader(model_paths=['ppo_model.zip', 'td3_model.zip', 'sac_model.zip'])
regime_detector = MarketRegimeDetector()
# Load market data
market_data = pd.read_csv('xauusd_data.csv')
# Detect market regime
regime, params = regime_detector.detect_regime(market_data)
# Make trading decision
state = preprocess_market_data(market_data)
signal, confidence = ensemble.predict(state)
# Apply confidence-based sizing
position_size = calculate_position_size(confidence, risk_per_trade=0.02)
print(f"Regime: {regime.value}")
print(f"Signal: {signal}, Confidence: {confidence:.3f}")
print(f"Position Size: {position_size:.4f}")
from live_ensemble_trading import LiveEnsembleTrader
# Initialize live trader
trader = LiveEnsembleTrader(
capital=1000,
leverage=50,
risk_per_trade=0.02
)
# Start automated trading
trader.start_live_trading()
This repository contains the following model files:
ppo_model.zip - PPO (Proximal Policy Optimization) modeltd3_model.zip - TD3 (Twin Delayed DDPG) modelsac_model.zip - SAC (Soft Actor-Critic) modelmarket_regime_detector.pkl - Trained regime detection modelfeature_scaler.pkl - Feature preprocessing scalermodel_config.json - Model configuration parametersregime_config.json - Regime-specific parametersThe system automatically detects 6 market conditions:
requirements.txtIf you use this model in your research, please cite:
@misc{nattapong2025ai,
title={AI-Driven XAUUSD Trading System: Maximum Profitability Framework},
author={JonusNattapong and Zombitx64},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/JonusNattapong/AI-XAUUSD-Trading}
}
This project is licensed under the MIT License - see the LICENSE file for details.
This model is for educational and research purposes only.
Trading cryptocurrencies and financial instruments involves substantial risk of loss. Past performance does not guarantee future results. Always test thoroughly in paper trading mode before deploying with real capital. Use proper risk management and never trade with money you cannot afford to lose.
The authors are not responsible for any financial losses incurred through the use of this model.
⭐ If this model helps your research, please star the repository!
🚀 Ready to explore AI-powered trading algorithms!