Files
XauBot/backtests/ml_v3/training_log_v3.txt
T

154 lines
30 KiB
Plaintext
Raw Normal View History

2026-02-09 15:56:02.634 | INFO  | src.mt5_connector:connect:177 - Connected to MT5: FinexBisnisSolusi-Demo (Account: 61045904)
2026-02-09 15:56:03.344 | DEBUG  | src.mt5_connector:get_market_data:449 - Fetched 50000 bars for XAUUSD M15
2026-02-09 15:56:03.546 | DEBUG  | src.mt5_connector:get_market_data:449 - Fetched 2000 bars for XAUUSD H1
2026-02-09 15:56:03.551 | DEBUG  | src.feature_eng:calculate_rsi:130 - RSI calculated (period=14)
2026-02-09 15:56:03.558 | DEBUG  | src.feature_eng:calculate_atr:185 - ATR calculated (period=14)
2026-02-09 15:56:03.560 | DEBUG  | src.feature_eng:calculate_macd:243 - MACD calculated (12/26/9)
2026-02-09 15:56:03.563 | DEBUG  | src.feature_eng:calculate_bollinger_bands:301 - Bollinger Bands calculated (period=20, std=2.0)
2026-02-09 15:56:03.565 | DEBUG  | src.feature_eng:calculate_ema_crossover:357 - EMA crossover calculated (9/21)
2026-02-09 15:56:03.567 | DEBUG  | src.feature_eng:calculate_volume_features:403 - Volume features calculated (period=20)
2026-02-09 15:56:03.575 | DEBUG  | src.feature_eng:calculate_ml_features:518 - ML features calculated
2026-02-09 15:56:03.579 | DEBUG  | src.smc_polars:calculate_swing_points:401 - Swing points: 3062 highs, 3079 lows
2026-02-09 15:56:03.582 | DEBUG  | src.smc_polars:calculate_fvg:312 - FVG calculation complete. Bullish: 5696, Bearish: 4720
2026-02-09 15:56:03.611 | DEBUG  | src.smc_polars:calculate_order_blocks:511 - Order Blocks: 2201 bullish, 2164 bearish
2026-02-09 15:56:03.782 | DEBUG  | src.smc_polars:calculate_bos_choch:599 - BOS: 702 bullish, 458 bearish
2026-02-09 15:56:03.782 | DEBUG  | src.smc_polars:calculate_bos_choch:600 - CHoCH: 616 bullish, 617 bearish
2026-02-09 15:56:03.783 | DEBUG  | src.feature_eng:calculate_rsi:130 - RSI calculated (period=14)
2026-02-09 15:56:03.784 | DEBUG  | src.feature_eng:calculate_atr:185 - ATR calculated (period=14)
2026-02-09 15:56:03.785 | DEBUG  | src.feature_eng:calculate_macd:243 - MACD calculated (12/26/9)
2026-02-09 15:56:03.786 | DEBUG  | src.feature_eng:calculate_bollinger_bands:301 - Bollinger Bands calculated (period=20, std=2.0)
2026-02-09 15:56:03.787 | DEBUG  | src.feature_eng:calculate_ema_crossover:357 - EMA crossover calculated (9/21)
2026-02-09 15:56:03.788 | DEBUG  | src.feature_eng:calculate_volume_features:403 - Volume features calculated (period=20)
2026-02-09 15:56:03.789 | DEBUG  | src.smc_polars:calculate_swing_points:401 - Swing points: 130 highs, 130 lows
2026-02-09 15:56:03.790 | DEBUG  | src.smc_polars:calculate_fvg:312 - FVG calculation complete. Bullish: 256, Bearish: 155
2026-02-09 15:56:03.793 | DEBUG  | src.smc_polars:calculate_order_blocks:511 - Order Blocks: 90 bullish, 82 bearish
2026-02-09 15:56:03.798 | DEBUG  | src.smc_polars:calculate_bos_choch:599 - BOS: 39 bullish, 20 bearish
2026-02-09 15:56:03.798 | DEBUG  | src.smc_polars:calculate_bos_choch:600 - CHoCH: 19 bullish, 19 bearish
[I 2026-02-09 15:56:04,025] 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.5 ATR
Stop loss: 0.5 ATR
Max holding: 20 bars
Min move threshold: 0.25 ATR
Target Distribution:
BUY: 27556 (55.11%)
SELL: 22409 (44.82%)
HOLD: 35 ( 0.07%)
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=55.1%, SELL=44.8%, HOLD=0.1%
Test distribution: BUY=55.1%, SELL=44.8%, HOLD=0.1%
Balancing TRAINING set only...
Balancing Classes...
Target distribution: BUY=35%, SELL=35%, HOLD=30%
Before: BUY=22045, SELL=17928, HOLD=28
After: BUY=17927, SELL=17927, HOLD=28
Total samples: 35882
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=427.17, BUY=0.67
Running Optuna hyperparameter optimization...
0%| | 0/30 [00:00<?, ?it/s]
0%| | 0/30 [00:05<?, ?it/s]
Best trial: 0. Best value: 0.449145: 0%| | 0/30 [00:05<?, ?it/s]
Best trial: 0. Best value: 0.449145: 3%|3 | 1/30 [00:05<02:31, 5.23s/it]
Best trial: 0. Best value: 0.449145: 3%|3 | 1/30 [00:08<02:31, 5.23s/it]
Best trial: 0. Best value: 0.449145: 3%|3 | 1/30 [00:08<02:31, 5.23s/it]
Best trial: 0. Best value: 0.449145: 7%|6 | 2/30 [00:08<01:53, 4.04s/it]
Best trial: 0. Best value: 0.449145: 7%|6 | 2/30 [00:22<01:53, 4.04s/it]
Best trial: 0. Best value: 0.449145: 7%|6 | 2/30 [00:22<01:53, 4.04s/it]
Best trial: 0. Best value: 0.449145: 10%|# | 3/30 [00:22<03:51, 8.58s/it]
Best trial: 0. Best value: 0.449145: 10%|# | 3/30 [00:45<03:51, 8.58s/it]
Best trial: 0. Best value: 0.449145: 10%|# | 3/30 [00:45<03:51, 8.58s/it]
Best trial: 0. Best value: 0.449145: 13%|#3 | 4/30 [00:45<06:12, 14.33s/it]
Best trial: 0. Best value: 0.449145: 13%|#3 | 4/30 [00:55<06:12, 14.33s/it]
Best trial: 0. Best value: 0.449145: 13%|#3 | 4/30 [00:55<06:12, 14.33s/it]
Best trial: 0. Best value: 0.449145: 17%|#6 | 5/30 [00:55<05:19, 12.76s/it]
Best trial: 0. Best value: 0.449145: 17%|#6 | 5/30 [01:04<05:19, 12.76s/it]
Best trial: 0. Best value: 0.449145: 17%|#6 | 5/30 [01:04<05:19, 12.76s/it]
Best trial: 0. Best value: 0.449145: 20%|## | 6/30 [01:04<04:38, 11.59s/it]
Best trial: 0. Best value: 0.449145: 20%|## | 6/30 [01:13<04:38, 11.59s/it]
Best trial: 0. Best value: 0.449145: 20%|## | 6/30 [01:13<04:38, 11.59s/it]
Best trial: 0. Best value: 0.449145: 23%|##3 | 7/30 [01:13<04:03, 10.60s/it]
Best trial: 0. Best value: 0.449145: 23%|##3 | 7/30 [01:22<04:03, 10.60s/it]
Best trial: 0. Best value: 0.449145: 23%|##3 | 7/30 [01:22<04:03, 10.60s/it]
Best trial: 0. Best value: 0.449145: 27%|##6 | 8/30 [01:22<03:39, 9.99s/it]
Best trial: 0. Best value: 0.449145: 27%|##6 | 8/30 [01:29<03:39, 9.99s/it]
Best trial: 0. Best value: 0.449145: 27%|##6 | 8/30 [01:29<03:39, 9.99s/it]
Best trial: 0. Best value: 0.449145: 30%|### | 9/30 [01:29<03:11, 9.12s/it]
Best trial: 0. Best value: 0.449145: 30%|### | 9/30 [01:39<03:11, 9.12s/it]
Best trial: 0. Best value: 0.449145: 30%|### | 9/30 [01:39<03:11, 9.12s/it]
Best trial: 0. Best value: 0.449145: 33%|###3 | 10/30 [01:39<03:06, 9.34s/it]
Best trial: 0. Best value: 0.449145: 33%|###3 | 10/30 [01:44<03:06, 9.34s/it]
Best trial: 0. Best value: 0.449145: 33%|###3 | 10/30 [01:44<03:06, 9.34s/it]
Best trial: 0. Best value: 0.449145: 37%|###6 | 11/30 [01:44<02:31, 7.98s/it]
Best trial: 0. Best value: 0.449145: 37%|###6 | 11/30 [01:49<02:31, 7.98s/it]
Best trial: 0. Best value: 0.449145: 37%|###6 | 11/30 [01:49<02:31, 7.98s/it]
Best trial: 0. Best value: 0.449145: 40%|#### | 12/30 [01:49<02:11, 7.32s/it]
Best trial: 0.
[I 2026-02-09 15:56:12,464] Trial 1 finished with value: 0.40574057405740577 and parameters: {'max_depth': 6, 'learning_rate': 0.014035786650788888, 'n_estimators': 100, 'min_child_weight': 6, 'gamma': 0.4520198942076511, 'subsample': 0.7117379418926268, 'colsample_bytree': 0.6855045453935482, 'reg_alpha': 0.516950503249026, 'reg_lambda': 0.041095146811625405}. Best is trial 0 with value: 0.44914491449144917.