Ensemble Signals: Multi-source signal confirmation (ML + Technical + SMC)
Performance Analytics
Monthly Performance Heatmap: Visual representation of returns across all test years
Risk-Return Scatter Plot: Performance comparison across different risk levels
Market Regime Analysis: Performance breakdown by trending vs sideways markets
Documentation Updates
Enhanced Technical Whitepaper: Added comprehensive visual diagrams and mathematical formulations
Enhanced Research Paper: Added Mermaid diagrams, advanced algorithms, and detailed performance analysis
Professional Exports: Both documents now available in HTML, Word, and LaTeX formats
Multi-Timeframe Trading System (Latest Addition)
Overview
The system has been extended to support intraday trading across multiple timeframes, enabling higher-frequency trading strategies while maintaining the proven SMC + technical indicator approach.
backtest_multi_timeframe_results.csv - Backtesting performance data
Next Steps
Complete 30m model training
Implement walk-forward optimization
Add extended historical data sources
Deploy best performing intraday model
Compare intraday vs daily performance
Model Description
This is an AI-powered trading model for XAUUSD (Gold vs US Dollar) futures, trained using Smart Money Concepts (SMC) strategy elements. The model uses machine learning to predict 5-day ahead price movements and generate trading signals with high win rates.
Key Features
Asset: XAUUSD (Gold Futures)
Strategy: Smart Money Concepts (SMC) with technical indicators
Prediction Horizon: 5-day ahead price direction
Model Type: XGBoost Classifier
Accuracy: 80.3% on test data
Win Rate: 85.4% in backtesting
Intended Use
This model is designed for:
Educational purposes in algorithmic trading
Research on SMC strategies
Backtesting trading strategies
Understanding ML applications in financial markets
⚠️ Warning: This is not financial advice. Trading involves risk of loss. Use at your own discretion.
Training Data
Source: Yahoo Finance (GC=F - Gold Futures)
Period: 2000-2020 (excluding recent months for efficiency)
Features: 23 features including:
Price data (Open, High, Low, Close, Volume)
Technical indicators (SMA, EMA, RSI, MACD, Bollinger Bands)
SMC features (Fair Value Gaps, Order Blocks, Recovery patterns)
Lag features (Close prices from previous days)
Target: Binary classification (1 if price rises in 5 days, 0 otherwise)
Dataset Size: 8,816 samples
Class Distribution: 54% down, 46% up (balanced with scale_pos_weight)
Performance Metrics
Model Performance
Accuracy: 80.3%
Precision (Class 1): 71%
Recall (Class 1): 81%
F1-Score: 76%
Backtesting Results (2015-2020)
Overall Win Rate: 85.4%
Total Return: 18.2%
Sharpe Ratio: 1.41
Yearly Win Rates:
2015: 62.5%
2016: 100.0%
2017: 100.0%
2018: 72.7%
2019: 76.9%
2020: 94.1%
Limitations
Trained on historical data only (2000-2020)
May not perform well in unprecedented market conditions
Requires proper risk management
No consideration of transaction costs, slippage, or market impact
Model predictions are probabilistic, not guaranteed
Usage
Prerequisites
pip install joblib scikit-learn pandas numpy
Loading the Model
python
1import joblib
2import pandas as pd
3from sklearn.preprocessing import StandardScaler
45# Load model6model = joblib.load('trading_model.pkl')78# Load scalers (you need to recreate or save them)9# ... preprocessing code ...1011# Prepare features12features = prepare_features(your_data)13prediction = model.predict(features)14probability = model.predict_proba(features)
Features Required
The model expects 23 features in this order:
Close
High
Low
Open
Volume
SMA_20
SMA_50
EMA_12
EMA_26
RSI
MACD
MACD_signal
MACD_hist
BB_upper
BB_middle
BB_lower
FVG_Size
FVG_Type_Encoded
OB_Type_Encoded
Recovery_Type_Encoded
Close_lag1
Close_lag2
Close_lag3
Training Details
Algorithm: XGBoost Classifier
Hyperparameters:
n_estimators: 200
max_depth: 7
learning_rate: 0.2
scale_pos_weight: 1.17 (for class balancing)
Cross-validation: 3-fold
Optimization: Grid search on hyperparameters
SMC Strategy Elements
The model incorporates Smart Money Concepts:
Fair Value Gaps (FVG): Price imbalances between candles
Order Blocks (OB): Areas of significant buying/selling
If you use this model in your research, please cite:
@misc{xauusd-trading-ai,
title={XAUUSD Trading AI Model with SMC Strategy},
author={AI Trading System},
year={2025},
url={https://huggingface.co/JonusNattapong/xauusd-trading-ai-smc}
}
Academic Paper
For the complete academic research paper with methodology, results, and analysis: