Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,420 +1,170 @@
|
|
| 1 |
---
|
| 2 |
language: en
|
| 3 |
-
license: mit
|
| 4 |
-
library_name: sklearn
|
| 5 |
tags:
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
datasets:
|
| 22 |
-
|
| 23 |
metrics:
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
model-index:
|
| 29 |
-
- name: xauusd-trading-ai-smc-daily
|
| 30 |
-
results:
|
| 31 |
-
- task:
|
| 32 |
-
type: binary-classification
|
| 33 |
-
name: Daily Price Direction Prediction
|
| 34 |
-
dataset:
|
| 35 |
-
type: yahoo-finance-gc-f
|
| 36 |
-
name: Gold Futures (GC=F)
|
| 37 |
-
metrics:
|
| 38 |
-
- type: accuracy
|
| 39 |
-
value: 80.3
|
| 40 |
-
name: Accuracy
|
| 41 |
-
- type: precision
|
| 42 |
-
value: 71
|
| 43 |
-
name: Precision (Class 1)
|
| 44 |
-
- type: recall
|
| 45 |
-
value: 81
|
| 46 |
-
name: Recall (Class 1)
|
| 47 |
-
- type: f1
|
| 48 |
-
value: 76
|
| 49 |
-
name: F1-Score
|
| 50 |
-
- name: xauusd-trading-ai-smc-15m
|
| 51 |
-
results:
|
| 52 |
-
- task:
|
| 53 |
-
type: binary-classification
|
| 54 |
-
name: 15-Minute Price Direction Prediction
|
| 55 |
-
dataset:
|
| 56 |
-
type: yahoo-finance-gc-f
|
| 57 |
-
name: Gold Futures (GC=F)
|
| 58 |
-
metrics:
|
| 59 |
-
- type: accuracy
|
| 60 |
-
value: 77.0
|
| 61 |
-
name: Accuracy
|
| 62 |
-
- type: precision
|
| 63 |
-
value: 76
|
| 64 |
-
name: Precision (Class 1)
|
| 65 |
-
- type: recall
|
| 66 |
-
value: 77
|
| 67 |
-
name: Recall (Class 1)
|
| 68 |
-
- type: f1
|
| 69 |
-
value: 76
|
| 70 |
-
name: F1-Score
|
| 71 |
-
---
|
| 72 |
---
|
| 73 |
|
| 74 |
-
#
|
| 75 |
-
|
| 76 |
-
## Files Included
|
| 77 |
-
|
| 78 |
-
### Core Models
|
| 79 |
-
- `trading_model.pkl` - Original daily timeframe XGBoost model (85.4% win rate)
|
| 80 |
-
- `trading_model_15m.pkl` - 15-minute intraday model (77% validation accuracy)
|
| 81 |
-
- `trading_model_1m.pkl` - 1-minute intraday model (partially trained)
|
| 82 |
-
- `trading_model_30m.pkl` - 30-minute intraday model (ready for training)
|
| 83 |
-
|
| 84 |
-
### Documentation
|
| 85 |
-
- `README.md` - This comprehensive model card
|
| 86 |
-
- `XAUUSD_Trading_AI_Paper.md` - **Research paper with academic structure, literature review, and methodology**
|
| 87 |
-
- `XAUUSD_Trading_AI_Paper.docx` - **Word document version (professional format)**
|
| 88 |
-
- `XAUUSD_Trading_AI_Paper.html` - **HTML web version (styled and readable)**
|
| 89 |
-
- `XAUUSD_Trading_AI_Paper.tex` - **LaTeX source (for academic publishing)**
|
| 90 |
-
- `XAUUSD_Trading_AI_Technical_Whitepaper.md` - **Technical whitepaper with mathematical formulations and implementation details**
|
| 91 |
-
- `XAUUSD_Trading_AI_Technical_Whitepaper.docx` - **Word document version (professional format)**
|
| 92 |
-
- `XAUUSD_Trading_AI_Technical_Whitepaper.html` - **HTML web version (styled and readable)**
|
| 93 |
-
- `XAUUSD_Trading_AI_Technical_Whitepaper.tex` - **LaTeX source (for academic publishing)**
|
| 94 |
-
|
| 95 |
-
### Performance & Analysis
|
| 96 |
-
- `backtest_report.csv` - Daily model yearly backtesting performance results
|
| 97 |
-
- `backtest_multi_timeframe_results.csv` - Intraday model backtesting results
|
| 98 |
-
- `feature_importance_15m.csv` - 15-minute model feature importance analysis
|
| 99 |
-
|
| 100 |
-
### Scripts & Tools
|
| 101 |
-
- `train_multi_timeframe.py` - Multi-timeframe model training script
|
| 102 |
-
- `backtest_multi_timeframe.py` - Intraday model backtesting framework
|
| 103 |
-
- `multi_timeframe_summary.py` - Comprehensive performance analysis tool
|
| 104 |
-
- `fetch_data.py` - Enhanced data acquisition for multiple timeframes
|
| 105 |
-
|
| 106 |
-
### Dataset Files
|
| 107 |
-
- **Daily Data**: `daily_data.csv`, `processed_daily_data.csv`, `smc_features_dataset.csv`, `X_features.csv`, `y_target.csv`
|
| 108 |
-
- **Intraday Data**: `1m_data.csv` (5,204 samples), `15m_data.csv` (3,814 samples), `30m_data.csv` (1,910 samples)
|
| 109 |
-
|
| 110 |
-
## Recent Enhancements (v2.0)
|
| 111 |
-
|
| 112 |
-
### Visual Documentation
|
| 113 |
-
- **Dataset Flow Diagram**: Complete data processing pipeline from raw Yahoo Finance data to model training
|
| 114 |
-
- **Model Architecture Diagram**: XGBoost ensemble structure with decision flow visualization
|
| 115 |
-
- **Buy/Sell Workflow Diagram**: End-to-end trading execution process with risk management
|
| 116 |
-
|
| 117 |
-
### Advanced Formulas & Techniques
|
| 118 |
-
- **Position Sizing Formula**: Risk-adjusted position calculation with Kelly Criterion adaptation
|
| 119 |
-
- **Risk Metrics**: Sharpe Ratio, Sortino Ratio, Calmar Ratio, and Maximum Drawdown calculations
|
| 120 |
-
- **SMC Techniques**: Advanced Order Block detection with volume profile analysis
|
| 121 |
-
- **Dynamic Thresholds**: Market volatility-based prediction threshold adjustment
|
| 122 |
-
- **Ensemble Signals**: Multi-source signal confirmation (ML + Technical + SMC)
|
| 123 |
-
|
| 124 |
-
### Performance Analytics
|
| 125 |
-
- **Monthly Performance Heatmap**: Visual representation of returns across all test years
|
| 126 |
-
- **Risk-Return Scatter Plot**: Performance comparison across different risk levels
|
| 127 |
-
- **Market Regime Analysis**: Performance breakdown by trending vs sideways markets
|
| 128 |
-
|
| 129 |
-
### Documentation Updates
|
| 130 |
-
- **Enhanced Technical Whitepaper**: Added comprehensive visual diagrams and mathematical formulations
|
| 131 |
-
- **Enhanced Research Paper**: Added Mermaid diagrams, advanced algorithms, and detailed performance analysis
|
| 132 |
-
- **Professional Exports**: Both documents now available in HTML, Word, and LaTeX formats
|
| 133 |
-
|
| 134 |
-
## Multi-Timeframe Trading System (Latest Addition)
|
| 135 |
-
|
| 136 |
-
### Overview
|
| 137 |
-
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.
|
| 138 |
-
|
| 139 |
-
### Supported Timeframes
|
| 140 |
-
- **1-minute (1m)**: Ultra-short-term scalping opportunities
|
| 141 |
-
- **15-minute (15m)**: Short-term swing trading
|
| 142 |
-
- **30-minute (30m)**: Medium-term position trading
|
| 143 |
-
- **Daily (1d)**: Original baseline model (85.4% win rate)
|
| 144 |
-
|
| 145 |
-
### Data Acquisition
|
| 146 |
-
- **Source**: Yahoo Finance API with enhanced intraday data fetching
|
| 147 |
-
- **Limitations**: Historical intraday data restricted (recent periods only)
|
| 148 |
-
- **Current Datasets**:
|
| 149 |
-
- 1m: 5,204 samples (7 days of recent data)
|
| 150 |
-
- 15m: 3,814 samples (60 days of recent data)
|
| 151 |
-
- 30m: 1,910 samples (60 days of recent data)
|
| 152 |
-
|
| 153 |
-
### Model Architecture
|
| 154 |
-
- **Base Algorithm**: XGBoost Classifier (same as daily model)
|
| 155 |
-
- **Features**: 23 features (technical indicators + SMC elements)
|
| 156 |
-
- **Training**: Grid search hyperparameter optimization
|
| 157 |
-
- **Validation**: 80/20 train/test split with stratification
|
| 158 |
-
|
| 159 |
-
### Training Results
|
| 160 |
-
- **15m Model**: Successfully trained with 77% validation accuracy
|
| 161 |
-
- **Feature Importance**: Technical indicators dominant (SMA_50, EMA_12, BB_lower)
|
| 162 |
-
- **Training Status**: 1m model partially trained, 30m model interrupted (available for completion)
|
| 163 |
-
|
| 164 |
-
### Backtesting Performance
|
| 165 |
-
- **Framework**: Backtrader with realistic commission modeling
|
| 166 |
-
- **Risk Management**: Fixed stake sizing ($1,000 per trade)
|
| 167 |
-
- **15m Results**: -0.83% return with 1 trade (conservative strategy)
|
| 168 |
-
- **Analysis**: Models show conservative behavior to avoid overtrading
|
| 169 |
-
|
| 170 |
-
### Key Insights
|
| 171 |
-
- ✅ Successfully scaled daily model architecture to intraday timeframes
|
| 172 |
-
- ✅ Technical indicators remain most important across all timeframes
|
| 173 |
-
- ✅ Conservative prediction thresholds prevent excessive trading
|
| 174 |
-
- ⚠️ Limited historical data affects backtesting statistical significance
|
| 175 |
-
- ⚠️ Yahoo Finance API constraints limit comprehensive validation
|
| 176 |
-
|
| 177 |
-
### Files Added
|
| 178 |
-
- `train_multi_timeframe.py` - Multi-timeframe model training script
|
| 179 |
-
- `backtest_multi_timeframe.py` - Intraday model backtesting framework
|
| 180 |
-
- `multi_timeframe_summary.py` - Comprehensive performance analysis
|
| 181 |
-
- `trading_model_15m.pkl` - Trained 15-minute model
|
| 182 |
-
- `feature_importance_15m.csv` - Feature importance analysis
|
| 183 |
-
- `backtest_multi_timeframe_results.csv` - Backtesting performance data
|
| 184 |
-
|
| 185 |
-
### Next Steps
|
| 186 |
-
1. Complete 30m model training
|
| 187 |
-
2. Implement walk-forward optimization
|
| 188 |
-
3. Add extended historical data sources
|
| 189 |
-
4. Deploy best performing intraday model
|
| 190 |
-
5. Compare intraday vs daily performance
|
| 191 |
-
|
| 192 |
-
## Model Description
|
| 193 |
-
|
| 194 |
-
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.
|
| 195 |
-
|
| 196 |
-
### Key Features
|
| 197 |
-
- **Asset**: XAUUSD (Gold Futures)
|
| 198 |
-
- **Strategy**: Smart Money Concepts (SMC) with technical indicators
|
| 199 |
-
- **Prediction Horizon**: 5-day ahead price direction
|
| 200 |
-
- **Model Type**: XGBoost Classifier
|
| 201 |
-
|
| 202 |
-
## Romeo (V5) — Ensemble model
|
| 203 |
-
|
| 204 |
-
Romeo (codename V5) is the latest ensemble model combining tree-based learners (XGBoost / LightGBM) and an optional Keras head. The artifacts live in `models_romeo/` and include a canonical feature list used by the backtester to align unseen data.
|
| 205 |
-
|
| 206 |
-
Artifacts
|
| 207 |
-
- `models_romeo/trading_model_romeo_daily.pkl` — ensemble artifact (joblib) with `models`, `weights`, and `features` keys.
|
| 208 |
-
- `models_romeo/romeo_keras_daily.keras` — optional Keras model file when included in training.
|
| 209 |
-
- `models_romeo/MODEL_CARD.md` — this model's card with evaluation and transparency notes.
|
| 210 |
-
|
| 211 |
-
Evaluation (selected run on unseen daily data)
|
| 212 |
-
- Initial capital: 100
|
| 213 |
-
- Final capital: 484.8199
|
| 214 |
-
- CAGR: 0.0444
|
| 215 |
-
- Annual volatility: 0.4118
|
| 216 |
-
- Sharpe: 0.3119
|
| 217 |
-
- Max Drawdown: -47.66%
|
| 218 |
-
- Total trades: 3610
|
| 219 |
-
- Win rate: 49.47%
|
| 220 |
-
|
| 221 |
-
Uploading to Hugging Face
|
| 222 |
-
-------------------------
|
| 223 |
-
There is a helper script to upload the model artifacts to Hugging Face Hub:
|
| 224 |
-
|
| 225 |
-
1. Install dependencies:
|
| 226 |
-
```bash
|
| 227 |
-
pip install huggingface_hub
|
| 228 |
-
```
|
| 229 |
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
|
| 235 |
-
3. Upload:
|
| 236 |
-
```cmd
|
| 237 |
-
python v5\upload_model_v5_to_hf.py --repo-name your-username/romeo-v5 --model-dir models_romeo
|
| 238 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
|
| 240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
|
|
|
|
|
|
| 245 |
|
|
|
|
|
|
|
|
|
|
| 246 |
```python
|
| 247 |
-
import
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
|
|
|
|
|
|
|
|
|
| 252 |
```
|
| 253 |
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
- **Accuracy**: 80.3% on test data
|
| 260 |
-
- **Win Rate**: 85.4% in backtesting
|
| 261 |
-
|
| 262 |
-
## Intended Use
|
| 263 |
-
|
| 264 |
-
This model is designed for:
|
| 265 |
-
- Educational purposes in algorithmic trading
|
| 266 |
-
- Research on SMC strategies
|
| 267 |
-
- Backtesting trading strategies
|
| 268 |
-
- Understanding ML applications in financial markets
|
| 269 |
-
|
| 270 |
-
**⚠️ Warning**: This is not financial advice. Trading involves risk of loss. Use at your own discretion.
|
| 271 |
-
|
| 272 |
-
## Training Data
|
| 273 |
-
|
| 274 |
-
- **Source**: Yahoo Finance (GC=F - Gold Futures)
|
| 275 |
-
- **Period**: 2000-2020 (excluding recent months for efficiency)
|
| 276 |
-
- **Features**: 23 features including:
|
| 277 |
-
- Price data (Open, High, Low, Close, Volume)
|
| 278 |
-
- Technical indicators (SMA, EMA, RSI, MACD, Bollinger Bands)
|
| 279 |
-
- SMC features (Fair Value Gaps, Order Blocks, Recovery patterns)
|
| 280 |
-
- Lag features (Close prices from previous days)
|
| 281 |
-
- **Target**: Binary classification (1 if price rises in 5 days, 0 otherwise)
|
| 282 |
-
- **Dataset Size**: 8,816 samples
|
| 283 |
-
- **Class Distribution**: 54% down, 46% up (balanced with scale_pos_weight)
|
| 284 |
-
|
| 285 |
-
## Performance Metrics
|
| 286 |
-
|
| 287 |
-
### Model Performance
|
| 288 |
-
- **Accuracy**: 80.3%
|
| 289 |
-
- **Precision (Class 1)**: 71%
|
| 290 |
-
- **Recall (Class 1)**: 81%
|
| 291 |
-
- **F1-Score**: 76%
|
| 292 |
-
|
| 293 |
-
### Backtesting Results (2015-2020)
|
| 294 |
-
- **Overall Win Rate**: 85.4%
|
| 295 |
-
- **Total Return**: 18.2%
|
| 296 |
-
- **Sharpe Ratio**: 1.41
|
| 297 |
-
- **Yearly Win Rates**:
|
| 298 |
-
- 2015: 62.5%
|
| 299 |
-
- 2016: 100.0%
|
| 300 |
-
- 2017: 100.0%
|
| 301 |
-
- 2018: 72.7%
|
| 302 |
-
- 2019: 76.9%
|
| 303 |
-
- 2020: 94.1%
|
| 304 |
-
|
| 305 |
-
## Limitations
|
| 306 |
-
|
| 307 |
-
- Trained on historical data only (2000-2020)
|
| 308 |
-
- May not perform well in unprecedented market conditions
|
| 309 |
-
- Requires proper risk management
|
| 310 |
-
- No consideration of transaction costs, slippage, or market impact
|
| 311 |
-
- Model predictions are probabilistic, not guaranteed
|
| 312 |
-
|
| 313 |
-
## Usage
|
| 314 |
-
|
| 315 |
-
### Prerequisites
|
| 316 |
-
```python
|
| 317 |
-
pip install joblib scikit-learn pandas numpy
|
| 318 |
```
|
| 319 |
|
| 320 |
-
###
|
| 321 |
-
```
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
|
| 326 |
-
|
| 327 |
-
model = joblib.load('trading_model.pkl')
|
| 328 |
|
| 329 |
-
|
| 330 |
-
|
|
|
|
|
|
|
|
|
|
| 331 |
|
| 332 |
-
|
| 333 |
-
features = prepare_features(your_data)
|
| 334 |
-
prediction = model.predict(features)
|
| 335 |
-
probability = model.predict_proba(features)
|
| 336 |
-
```
|
| 337 |
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
7. SMA_50
|
| 347 |
-
8. EMA_12
|
| 348 |
-
9. EMA_26
|
| 349 |
-
10. RSI
|
| 350 |
-
11. MACD
|
| 351 |
-
12. MACD_signal
|
| 352 |
-
13. MACD_hist
|
| 353 |
-
14. BB_upper
|
| 354 |
-
15. BB_middle
|
| 355 |
-
16. BB_lower
|
| 356 |
-
17. FVG_Size
|
| 357 |
-
18. FVG_Type_Encoded
|
| 358 |
-
19. OB_Type_Encoded
|
| 359 |
-
20. Recovery_Type_Encoded
|
| 360 |
-
21. Close_lag1
|
| 361 |
-
22. Close_lag2
|
| 362 |
-
23. Close_lag3
|
| 363 |
-
|
| 364 |
-
## Training Details
|
| 365 |
-
|
| 366 |
-
- **Algorithm**: XGBoost Classifier
|
| 367 |
-
- **Hyperparameters**:
|
| 368 |
-
- n_estimators: 200
|
| 369 |
-
- max_depth: 7
|
| 370 |
-
- learning_rate: 0.2
|
| 371 |
-
- scale_pos_weight: 1.17 (for class balancing)
|
| 372 |
-
- **Cross-validation**: 3-fold
|
| 373 |
-
- **Optimization**: Grid search on hyperparameters
|
| 374 |
-
|
| 375 |
-
## SMC Strategy Elements
|
| 376 |
-
|
| 377 |
-
The model incorporates Smart Money Concepts:
|
| 378 |
-
- **Fair Value Gaps (FVG)**: Price imbalances between candles
|
| 379 |
-
- **Order Blocks (OB)**: Areas of significant buying/selling
|
| 380 |
-
- **Recovery Patterns**: Pullbacks in trending markets
|
| 381 |
-
|
| 382 |
-
## Upload to Hugging Face
|
| 383 |
-
|
| 384 |
-
To share this model on Hugging Face:
|
| 385 |
-
|
| 386 |
-
1. Create a Hugging Face account at https://huggingface.co/join
|
| 387 |
-
2. Generate an access token at https://huggingface.co/settings/tokens with "Write" permissions
|
| 388 |
-
3. Test your token: `python test_token.py YOUR_TOKEN`
|
| 389 |
-
4. Upload: `python upload_to_hf.py YOUR_TOKEN`
|
| 390 |
-
|
| 391 |
-
The script will upload:
|
| 392 |
-
- `trading_model.pkl` - The trained XGBoost model
|
| 393 |
-
- `README.md` - This model card with metadata
|
| 394 |
-
- All dataset files (CSV format)
|
| 395 |
-
|
| 396 |
-
## Citation
|
| 397 |
|
| 398 |
If you use this model in your research, please cite:
|
| 399 |
|
| 400 |
-
```
|
| 401 |
-
@misc{
|
| 402 |
-
title={
|
| 403 |
-
author={
|
| 404 |
year={2025},
|
| 405 |
-
|
|
|
|
| 406 |
}
|
| 407 |
```
|
| 408 |
|
| 409 |
-
|
| 410 |
-
For the complete academic research paper with methodology, results, and analysis:
|
| 411 |
|
| 412 |
-
|
| 413 |
|
| 414 |
-
##
|
| 415 |
|
| 416 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 417 |
|
| 418 |
-
## Contact
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 419 |
|
| 420 |
-
|
|
|
|
| 1 |
---
|
| 2 |
language: en
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
+
- trading
|
| 5 |
+
- finance
|
| 6 |
+
- xauusd
|
| 7 |
+
- gold
|
| 8 |
+
- forex
|
| 9 |
+
- machine-learning
|
| 10 |
+
- ensemble
|
| 11 |
+
- super-ensemble
|
| 12 |
+
- xgboost
|
| 13 |
+
- lightgbm
|
| 14 |
+
- catboost
|
| 15 |
+
- neural-network
|
| 16 |
+
- tensorflow
|
| 17 |
+
- sklearn
|
| 18 |
+
license: mit
|
| 19 |
datasets:
|
| 20 |
+
- custom
|
| 21 |
metrics:
|
| 22 |
+
- accuracy: 0.682
|
| 23 |
+
- profit-factor: 2.16
|
| 24 |
+
- sharpe-ratio: 4.64
|
| 25 |
+
- max-drawdown: 0.111
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
---
|
| 27 |
|
| 28 |
+
# Romeo V8 Super Ensemble Trading AI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
Romeo V8 is an advanced super ensemble trading model that combines **10+ different algorithms** working collaboratively for maximum accuracy and efficiency in XAUUSD (Gold vs US Dollar) trading.
|
| 31 |
+
|
| 32 |
+
## 🚀 Key Features
|
| 33 |
+
|
| 34 |
+
- **Super Ensemble Architecture**: 10 algorithms working together (XGBoost, LightGBM, CatBoost, RandomForest, ExtraTrees, Neural Networks, SVM, KNN, LogisticRegression, NaiveBayes)
|
| 35 |
+
- **Stacking Meta-Learner**: Intelligent combination of base learner predictions
|
| 36 |
+
- **Dynamic Weighting**: Real-time weight adjustment based on performance
|
| 37 |
+
- **Confidence Calibration**: Calibrated probability fusion using isotonic regression
|
| 38 |
+
- **Cross-Validation Ensemble**: Multiple CV folds combined for robustness
|
| 39 |
+
- **Advanced Risk Management**: Multi-algorithm consensus scoring with position sizing
|
| 40 |
+
|
| 41 |
+
## 📊 Performance Metrics
|
| 42 |
+
|
| 43 |
+
| Metric | Value |
|
| 44 |
+
|--------|-------|
|
| 45 |
+
| **Win Rate** | 68.18% |
|
| 46 |
+
| **Profit Factor** | 2.16 |
|
| 47 |
+
| **Sharpe Ratio** | 4.64 |
|
| 48 |
+
| **Max Drawdown** | 11.06% |
|
| 49 |
+
| **Total Return** | 26.81% |
|
| 50 |
+
| **Total Trades** | 66 |
|
| 51 |
+
|
| 52 |
+
## 🏗️ Architecture
|
| 53 |
|
|
|
|
|
|
|
|
|
|
| 54 |
```
|
| 55 |
+
Super Ensemble Pipeline:
|
| 56 |
+
├── Base Learners (10 algorithms)
|
| 57 |
+
│ ├── XGBoost, LightGBM, CatBoost
|
| 58 |
+
│ ├── RandomForest, ExtraTrees
|
| 59 |
+
│ ├── Neural Networks (Keras/TensorFlow)
|
| 60 |
+
│ ├── SVM, KNN, LogisticRegression, NaiveBayes
|
| 61 |
+
│ └── Individual training with cross-validation
|
| 62 |
+
├── Confidence Calibration
|
| 63 |
+
│ └── Isotonic regression for probability calibration
|
| 64 |
+
├── Stacking Meta-Learner
|
| 65 |
+
│ └── LogisticRegression combining base predictions
|
| 66 |
+
├── Dynamic Weighting
|
| 67 |
+
│ └── Real-time weight optimization
|
| 68 |
+
└── Cross-Validation Ensemble
|
| 69 |
+
└── Multiple CV fold combination
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## 📈 Advanced Features
|
| 73 |
+
|
| 74 |
+
### Technical Indicators (15+)
|
| 75 |
+
- Moving Averages (SMA, EMA)
|
| 76 |
+
- Oscillators (RSI, MACD, Stochastic)
|
| 77 |
+
- Volatility (Bollinger Bands, ATR)
|
| 78 |
+
- Volume (MFI, OBV)
|
| 79 |
+
- Momentum indicators
|
| 80 |
|
| 81 |
+
### Quantum-Inspired Features
|
| 82 |
+
- Entropy calculations
|
| 83 |
+
- Phase space analysis
|
| 84 |
+
- Amplitude modulation
|
| 85 |
+
- Wavelet energy features
|
| 86 |
|
| 87 |
+
### Algorithm Collaboration Features
|
| 88 |
+
- Trend strength indicators
|
| 89 |
+
- Volume confirmation signals
|
| 90 |
+
- Fractal dimension analysis
|
| 91 |
+
- Consensus scoring
|
| 92 |
|
| 93 |
+
## 🛠️ Usage
|
| 94 |
+
|
| 95 |
+
### Quick Start
|
| 96 |
```python
|
| 97 |
+
from v8.train_v8 import load_romeo_v8, SuperEnsemble
|
| 98 |
+
|
| 99 |
+
# Load the trained model
|
| 100 |
+
model = load_romeo_v8('v8/models_romeo_v8/trading_model_romeo_15m.pkl')
|
| 101 |
+
|
| 102 |
+
# Make predictions
|
| 103 |
+
predictions = model.predict(your_data)
|
| 104 |
+
probabilities = model.predict_proba(your_data)
|
| 105 |
```
|
| 106 |
|
| 107 |
+
### Backtesting
|
| 108 |
+
```bash
|
| 109 |
+
# Run backtest on 15m timeframe
|
| 110 |
+
python v8/backtest_v8.py --timeframe 15m --initial-capital 100
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
```
|
| 112 |
|
| 113 |
+
### Training
|
| 114 |
+
```bash
|
| 115 |
+
# Train full model
|
| 116 |
+
python v8/train_v8.py --data data_xauusd_v3/15m_data_v3.csv --timeframe 15m --mode full
|
| 117 |
+
```
|
| 118 |
|
| 119 |
+
## 📊 Data
|
|
|
|
| 120 |
|
| 121 |
+
The model is trained on enhanced XAUUSD data with:
|
| 122 |
+
- **Timeframes**: 1m, 15m, 30m, 1h, 4h, daily
|
| 123 |
+
- **Features**: 50+ engineered features per sample
|
| 124 |
+
- **Quality**: Clean, processed, and validated data
|
| 125 |
+
- **Period**: Multi-year historical data
|
| 126 |
|
| 127 |
+
## 🔬 Research & Development
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
+
This model represents the culmination of extensive research in:
|
| 130 |
+
- Ensemble learning for financial prediction
|
| 131 |
+
- Algorithm collaboration techniques
|
| 132 |
+
- Risk management in algorithmic trading
|
| 133 |
+
- Feature engineering for time series data
|
| 134 |
+
- Neural network integration with traditional ML
|
| 135 |
+
|
| 136 |
+
## 📝 Citation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
|
| 138 |
If you use this model in your research, please cite:
|
| 139 |
|
| 140 |
+
```bibtex
|
| 141 |
+
@misc{jonusnattapong_romeo_v8,
|
| 142 |
+
title={Romeo V8 Super Ensemble Trading AI},
|
| 143 |
+
author={Jonus Nattapong},
|
| 144 |
year={2025},
|
| 145 |
+
publisher={Hugging Face},
|
| 146 |
+
url={https://huggingface.co/JonusNattapong/romeo-v8-super-ensemble-trading-ai}
|
| 147 |
}
|
| 148 |
```
|
| 149 |
|
| 150 |
+
## ⚠️ Disclaimer
|
|
|
|
| 151 |
|
| 152 |
+
This model is for research and educational purposes only. Trading involves substantial risk of loss and is not suitable for all investors. Past performance does not guarantee future results. Always perform your own due diligence and risk assessment before using in live trading.
|
| 153 |
|
| 154 |
+
## 🤝 Contributing
|
| 155 |
|
| 156 |
+
Contributions are welcome! Please feel free to:
|
| 157 |
+
- Report issues
|
| 158 |
+
- Suggest improvements
|
| 159 |
+
- Submit pull requests
|
| 160 |
+
- Share your results
|
| 161 |
|
| 162 |
+
## 📧 Contact
|
| 163 |
+
|
| 164 |
+
For questions or collaboration opportunities:
|
| 165 |
+
- GitHub: [JonusNattapong](https://github.com/JonusNattapong)
|
| 166 |
+
- LinkedIn: [Your LinkedIn Profile]
|
| 167 |
+
|
| 168 |
+
---
|
| 169 |
|
| 170 |
+
*Built with ❤️ for the quantitative finance community*
|