Files
XauBot/backtests/ml_v3/training_log_v2.txt
T

154 lines
30 KiB
Plaintext
Raw Normal View History

2026-02-09 15:45:37.208 | INFO  | src.mt5_connector:connect:177 - Connected to MT5: FinexBisnisSolusi-Demo (Account: 61045904)
2026-02-09 15:45:37.919 | DEBUG  | src.mt5_connector:get_market_data:449 - Fetched 50000 bars for XAUUSD M15
2026-02-09 15:45:38.123 | DEBUG  | src.mt5_connector:get_market_data:449 - Fetched 2000 bars for XAUUSD H1
2026-02-09 15:45:38.128 | DEBUG  | src.feature_eng:calculate_rsi:130 - RSI calculated (period=14)
2026-02-09 15:45:38.131 | DEBUG  | src.feature_eng:calculate_atr:185 - ATR calculated (period=14)
2026-02-09 15:45:38.133 | DEBUG  | src.feature_eng:calculate_macd:243 - MACD calculated (12/26/9)
2026-02-09 15:45:38.136 | DEBUG  | src.feature_eng:calculate_bollinger_bands:301 - Bollinger Bands calculated (period=20, std=2.0)
2026-02-09 15:45:38.139 | DEBUG  | src.feature_eng:calculate_ema_crossover:357 - EMA crossover calculated (9/21)
2026-02-09 15:45:38.140 | DEBUG  | src.feature_eng:calculate_volume_features:403 - Volume features calculated (period=20)
2026-02-09 15:45:38.149 | DEBUG  | src.feature_eng:calculate_ml_features:518 - ML features calculated
2026-02-09 15:45:38.154 | DEBUG  | src.smc_polars:calculate_swing_points:401 - Swing points: 3062 highs, 3079 lows
2026-02-09 15:45:38.156 | DEBUG  | src.smc_polars:calculate_fvg:312 - FVG calculation complete. Bullish: 5696, Bearish: 4720
2026-02-09 15:45:38.177 | DEBUG  | src.smc_polars:calculate_order_blocks:511 - Order Blocks: 2201 bullish, 2164 bearish
2026-02-09 15:45:38.284 | DEBUG  | src.smc_polars:calculate_bos_choch:599 - BOS: 702 bullish, 458 bearish
2026-02-09 15:45:38.284 | DEBUG  | src.smc_polars:calculate_bos_choch:600 - CHoCH: 616 bullish, 617 bearish
2026-02-09 15:45:38.286 | DEBUG  | src.feature_eng:calculate_rsi:130 - RSI calculated (period=14)
2026-02-09 15:45:38.288 | DEBUG  | src.feature_eng:calculate_atr:185 - ATR calculated (period=14)
2026-02-09 15:45:38.289 | DEBUG  | src.feature_eng:calculate_macd:243 - MACD calculated (12/26/9)
2026-02-09 15:45:38.290 | DEBUG  | src.feature_eng:calculate_bollinger_bands:301 - Bollinger Bands calculated (period=20, std=2.0)
2026-02-09 15:45:38.291 | DEBUG  | src.feature_eng:calculate_ema_crossover:357 - EMA crossover calculated (9/21)
2026-02-09 15:45:38.291 | DEBUG  | src.feature_eng:calculate_volume_features:403 - Volume features calculated (period=20)
2026-02-09 15:45:38.293 | DEBUG  | src.smc_polars:calculate_swing_points:401 - Swing points: 130 highs, 130 lows
2026-02-09 15:45:38.294 | DEBUG  | src.smc_polars:calculate_fvg:312 - FVG calculation complete. Bullish: 256, Bearish: 155
2026-02-09 15:45:38.297 | DEBUG  | src.smc_polars:calculate_order_blocks:511 - Order Blocks: 90 bullish, 82 bearish
2026-02-09 15:45:38.303 | DEBUG  | src.smc_polars:calculate_bos_choch:599 - BOS: 39 bullish, 20 bearish
2026-02-09 15:45:38.303 | DEBUG  | src.smc_polars:calculate_bos_choch:600 - CHoCH: 19 bullish, 19 bearish
[I 2026-02-09 15:45:38,481] A new study created in memory with name: xgboost_opt
================================================================================
ML MODEL V3 TRAINING PIPELINE
Bismillah - Building Exceptional Model
================================================================================
Fetching 50,000 bars of M15 data...
Symbol: XAUUSD
Timeframe: M15
Fetched 50,000 bars
Date range: 2023-12-27 08:45:00 to 2026-02-09 10:45:00
Fetching 2,000 bars of H1 data...
Fetched 2,000 H1 bars
Engineering features...
M15 technical indicators...
SMC structure features...
H1 higher timeframe features...
Total features: 70
Columns with nulls: 45
rsi, atr, atr_percent, bb_middle, bb_upper, bb_lower, bb_width, bb_percent_b, volume_sma, volume_ratio
Filling nulls with forward fill...
Labeling data with Triple Barrier Method...
Starting Triple Barrier Labeling...
Profit target: 0.25 ATR
Stop loss: 0.2 ATR
Max holding: 10 bars
Min move threshold: 0.15 ATR
Target Distribution:
BUY: 33040 (66.08%)
SELL: 16937 (33.87%)
HOLD: 23 ( 0.05%)
Quality Metrics:
Profit barriers hit: 0 ( 0.00%)
Avg bars to profit: 0.0
Avg return (ATR): 0.000
Splitting train/test (stratified)...
Train: 40,001 samples
Test: 9,999 samples
Train distribution: BUY=66.1%, SELL=33.9%, HOLD=0.0%
Test distribution: BUY=66.1%, SELL=33.9%, HOLD=0.0%
Balancing TRAINING set only...
Balancing Classes...
Target distribution: BUY=33%, SELL=33%, HOLD=34%
Before: BUY=26432, SELL=13550, HOLD=19
After: BUY=13549, SELL=13549, HOLD=19
Total samples: 27117
Selected 69 features
Sample features: spread, rsi, atr, atr_percent, macd, macd_signal, macd_histogram, bb_middle, bb_upper, bb_lower...
Training XGBoost model...
Class weights: SELL=0.67, HOLD=475.74, BUY=0.67
Running Optuna hyperparameter optimization...
0%| | 0/30 [00:00<?, ?it/s]
0%| | 0/30 [00:09<?, ?it/s]
Best trial: 0. Best value: 0.615462: 0%| | 0/30 [00:09<?, ?it/s]
Best trial: 0. Best value: 0.615462: 3%|3 | 1/30 [00:09<04:36, 9.55s/it]
Best trial: 0. Best value: 0.615462: 3%|3 | 1/30 [00:16<04:36, 9.55s/it]
Best trial: 0. Best value: 0.615462: 3%|3 | 1/30 [00:16<04:36, 9.55s/it]
Best trial: 0. Best value: 0.615462: 7%|6 | 2/30 [00:16<03:37, 7.76s/it]
Best trial: 0. Best value: 0.615462: 7%|6 | 2/30 [00:23<03:37, 7.76s/it]
Best trial: 0. Best value: 0.615462: 7%|6 | 2/30 [00:23<03:37, 7.76s/it]
Best trial: 0. Best value: 0.615462: 10%|# | 3/30 [00:23<03:26, 7.63s/it]
Best trial: 0. Best value: 0.615462: 10%|# | 3/30 [00:36<03:26, 7.63s/it]
Best trial: 0. Best value: 0.615462: 10%|# | 3/30 [00:36<03:26, 7.63s/it]
Best trial: 0. Best value: 0.615462: 13%|#3 | 4/30 [00:36<04:18, 9.93s/it]
Best trial: 0. Best value: 0.615462: 13%|#3 | 4/30 [00:42<04:18, 9.93s/it]
Best trial: 0. Best value: 0.615462: 13%|#3 | 4/30 [00:42<04:18, 9.93s/it]
Best trial: 0. Best value: 0.615462: 17%|#6 | 5/30 [00:42<03:32, 8.50s/it]
Best trial: 0. Best value: 0.615462: 17%|#6 | 5/30 [00:55<03:32, 8.50s/it]
Best trial: 0. Best value: 0.615462: 17%|#6 | 5/30 [00:55<03:32, 8.50s/it]
Best trial: 0. Best value: 0.615462: 20%|## | 6/30 [00:55<04:00, 10.02s/it]
Best trial: 0. Best value: 0.615462: 20%|## | 6/30 [01:00<04:00, 10.02s/it]
Best trial: 0. Best value: 0.615462: 20%|## | 6/30 [01:00<04:00, 10.02s/it]
Best trial: 0. Best value: 0.615462: 23%|##3 | 7/30 [01:00<03:09, 8.22s/it]
Best trial: 0. Best value: 0.615462: 23%|##3 | 7/30 [01:09<03:09, 8.22s/it]
Best trial: 0. Best value: 0.615462: 23%|##3 | 7/30 [01:09<03:09, 8.22s/it]
Best trial: 0. Best value: 0.615462: 27%|##6 | 8/30 [01:09<03:08, 8.58s/it]
Best trial: 0. Best value: 0.615462: 27%|##6 | 8/30 [01:14<03:08, 8.58s/it]
Best trial: 0. Best value: 0.615462: 27%|##6 | 8/30 [01:14<03:08, 8.58s/it]
Best trial: 0. Best value: 0.615462: 30%|### | 9/30 [01:14<02:35, 7.43s/it]
Best trial: 0. Best value: 0.615462: 30%|### | 9/30 [01:27<02:35, 7.43s/it]
Best trial: 0. Best value: 0.615462: 30%|### | 9/30 [01:27<02:35, 7.43s/it]
Best trial: 0. Best value: 0.615462: 33%|###3 | 10/30 [01:27<02:59, 8.99s/it]
Best trial: 0. Best value: 0.615462: 33%|###3 | 10/30 [01:30<02:59, 8.99s/it]
Best trial: 10. Best value: 0.623962: 33%|###3 | 10/30 [01:30<02:59, 8.99s/it]
Best trial: 10. Best value: 0.623962: 37%|###6 | 11/30 [01:30<02:18, 7.30s/it]
Best trial: 10. Best value: 0.623962: 37%|###6 | 11/30 [01:34<02:18, 7.30s/it]
Best trial: 10. Best value: 0.623962: 37%|###6 | 11/30 [01:34<02:18, 7.30s/it]
Best trial: 10. Best value: 0.623962: 40%|#### | 12/30 [01:34<01:51, 6.17s/it]
Best tr
[I 2026-02-09 15:45:54,540] Trial 1 finished with value: 0.592959295929593 and parameters: {'max_depth': 6, 'learning_rate': 0.04909064102193004, 'n_estimators': 300, 'min_child_weight': 6, 'gamma': 0.4901937824884972, 'subsample': 0.7539794301751772, 'colsample_bytree': 0.6097878651974575, 'reg_alpha': 0.9015362642496044, 'reg_lambda': 1.0797781941079094}. Best is trial 0 with value: 0.6154615461546155.