Files
XauBot/backtests/ml_v3/training_log_v3_binary.txt
T

158 lines
30 KiB
Plaintext
Raw Normal View History

2026-02-09 16:24:05.125 | INFO  | src.mt5_connector:connect:177 - Connected to MT5: FinexBisnisSolusi-Demo (Account: 61045904)
2026-02-09 16:24:05.837 | DEBUG  | src.mt5_connector:get_market_data:449 - Fetched 50000 bars for XAUUSD M15
2026-02-09 16:24:06.039 | DEBUG  | src.mt5_connector:get_market_data:449 - Fetched 2000 bars for XAUUSD H1
2026-02-09 16:24:06.045 | DEBUG  | src.feature_eng:calculate_rsi:130 - RSI calculated (period=14)
2026-02-09 16:24:06.049 | DEBUG  | src.feature_eng:calculate_atr:185 - ATR calculated (period=14)
2026-02-09 16:24:06.051 | DEBUG  | src.feature_eng:calculate_macd:243 - MACD calculated (12/26/9)
2026-02-09 16:24:06.054 | DEBUG  | src.feature_eng:calculate_bollinger_bands:301 - Bollinger Bands calculated (period=20, std=2.0)
2026-02-09 16:24:06.056 | DEBUG  | src.feature_eng:calculate_ema_crossover:357 - EMA crossover calculated (9/21)
2026-02-09 16:24:06.058 | DEBUG  | src.feature_eng:calculate_volume_features:403 - Volume features calculated (period=20)
2026-02-09 16:24:06.068 | DEBUG  | src.feature_eng:calculate_ml_features:518 - ML features calculated
2026-02-09 16:24:06.072 | DEBUG  | src.smc_polars:calculate_swing_points:401 - Swing points: 3062 highs, 3079 lows
2026-02-09 16:24:06.074 | DEBUG  | src.smc_polars:calculate_fvg:312 - FVG calculation complete. Bullish: 5696, Bearish: 4720
2026-02-09 16:24:06.100 | DEBUG  | src.smc_polars:calculate_order_blocks:511 - Order Blocks: 2201 bullish, 2164 bearish
2026-02-09 16:24:06.237 | DEBUG  | src.smc_polars:calculate_bos_choch:599 - BOS: 702 bullish, 458 bearish
2026-02-09 16:24:06.238 | DEBUG  | src.smc_polars:calculate_bos_choch:600 - CHoCH: 616 bullish, 617 bearish
2026-02-09 16:24:06.239 | DEBUG  | src.feature_eng:calculate_rsi:130 - RSI calculated (period=14)
2026-02-09 16:24:06.241 | DEBUG  | src.feature_eng:calculate_atr:185 - ATR calculated (period=14)
2026-02-09 16:24:06.242 | DEBUG  | src.feature_eng:calculate_macd:243 - MACD calculated (12/26/9)
2026-02-09 16:24:06.242 | DEBUG  | src.feature_eng:calculate_bollinger_bands:301 - Bollinger Bands calculated (period=20, std=2.0)
2026-02-09 16:24:06.244 | DEBUG  | src.feature_eng:calculate_ema_crossover:357 - EMA crossover calculated (9/21)
2026-02-09 16:24:06.244 | DEBUG  | src.feature_eng:calculate_volume_features:403 - Volume features calculated (period=20)
2026-02-09 16:24:06.246 | DEBUG  | src.smc_polars:calculate_swing_points:401 - Swing points: 130 highs, 130 lows
2026-02-09 16:24:06.247 | DEBUG  | src.smc_polars:calculate_fvg:312 - FVG calculation complete. Bullish: 256, Bearish: 155
2026-02-09 16:24:06.249 | DEBUG  | src.smc_polars:calculate_order_blocks:511 - Order Blocks: 90 bullish, 82 bearish
2026-02-09 16:24:06.256 | DEBUG  | src.smc_polars:calculate_bos_choch:599 - BOS: 39 bullish, 20 bearish
2026-02-09 16:24:06.256 | DEBUG  | src.smc_polars:calculate_bos_choch:600 - CHoCH: 19 bullish, 19 bearish
[I 2026-02-09 16:24:06,480] 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 09:15:00 to 2026-02-09 11:15: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 (BINARY)...
Starting Triple Barrier Labeling (BINARY: BUY vs SELL)...
Profit target: 0.5 ATR
Stop loss: 0.5 ATR
Max holding: 20 bars
Target Distribution (BINARY):
BUY: 27558 (55.14%)
SELL: 22422 (44.86%)
Unlabeled: 20 (last 20 bars)
Quality Metrics:
Profit barriers hit: 0 ( 0.00%)
Avg bars to profit: 0.0
Avg return (ATR): 0.000
Splitting train/test (stratified, BINARY)...
Train: 39,985 samples
Test: 9,995 samples
Train distribution: BUY=55.1%, SELL=44.9%
Test distribution: BUY=55.1%, SELL=44.9%
Balancing TRAINING set only (BINARY)...
Balancing Classes (BINARY)...
Target distribution: BUY=50%, SELL=50%
Before: BUY=22047, SELL=17938
After: BUY=17938, SELL=17938
Total samples: 35876
Selected 69 features
Sample features: spread, rsi, atr, atr_percent, macd, macd_signal, macd_histogram, bb_middle, bb_upper, bb_lower...
Training XGBoost model (BINARY: BUY vs SELL)...
Training classes: [0 1] (expected: [0, 1])
Class weights: SELL=1.00, BUY=1.00
Class distribution: SELL=17938 (50.0%), BUY=17938 (50.0%)
Running Optuna hyperparameter optimization...
0%| | 0/30 [00:00<?, ?it/s]
0%| | 0/30 [00:04<?, ?it/s]
Best trial: 0. Best value: 0.542971: 0%| | 0/30 [00:04<?, ?it/s]
Best trial: 0. Best value: 0.542971: 3%|3 | 1/30 [00:04<02:10, 4.49s/it]
Best trial: 0. Best value: 0.542971: 3%|3 | 1/30 [00:08<02:10, 4.49s/it]
Best trial: 0. Best value: 0.542971: 3%|3 | 1/30 [00:08<02:10, 4.49s/it]
Best trial: 0. Best value: 0.542971: 7%|6 | 2/30 [00:08<01:55, 4.11s/it]
Best trial: 0. Best value: 0.542971: 7%|6 | 2/30 [00:13<01:55, 4.11s/it]
Best trial: 0. Best value: 0.542971: 7%|6 | 2/30 [00:13<01:55, 4.11s/it]
Best trial: 0. Best value: 0.542971: 10%|# | 3/30 [00:13<02:04, 4.61s/it]
Best trial: 0. Best value: 0.542971: 10%|# | 3/30 [00:16<02:04, 4.61s/it]
Best trial: 0. Best value: 0.542971: 10%|# | 3/30 [00:16<02:04, 4.61s/it]
Best trial: 0. Best value: 0.542971: 13%|#3 | 4/30 [00:16<01:46, 4.08s/it]
Best trial: 0. Best value: 0.542971: 13%|#3 | 4/30 [00:23<01:46, 4.08s/it]
Best trial: 0. Best value: 0.542971: 13%|#3 | 4/30 [00:23<01:46, 4.08s/it]
Best trial: 0. Best value: 0.542971: 17%|#6 | 5/30 [00:23<02:09, 5.19s/it]
Best trial: 0. Best value: 0.542971: 17%|#6 | 5/30 [00:27<02:09, 5.19s/it]
Best trial: 0. Best value: 0.542971: 17%|#6 | 5/30 [00:27<02:09, 5.19s/it]
Best trial: 0. Best value: 0.542971: 20%|## | 6/30 [00:27<01:52, 4.68s/it]
Best trial: 0. Best value: 0.542971: 20%|## | 6/30 [00:33<01:52, 4.68s/it]
Best trial: 0. Best value: 0.542971: 20%|## | 6/30 [00:33<01:52, 4.68s/it]
Best trial: 0. Best value: 0.542971: 23%|##3 | 7/30 [00:33<01:57, 5.10s/it]
Best trial: 0. Best value: 0.542971: 23%|##3 | 7/30 [00:36<01:57, 5.10s/it]
Best trial: 0. Best value: 0.542971: 23%|##3 | 7/30 [00:36<01:57, 5.10s/it]
Best trial: 0. Best value: 0.542971: 27%|##6 | 8/30 [00:36<01:35, 4.33s/it]
Best trial: 0. Best value: 0.542971: 27%|##6 | 8/30 [00:41<01:35, 4.33s/it]
Best trial: 0. Best value: 0.542971: 27%|##6 | 8/30 [00:41<01:35, 4.33s/it]
Best trial: 0. Best value: 0.542971: 30%|### | 9/30 [00:41<01:33, 4.45s/it]
Best trial: 0. Best value: 0.542971: 30%|### | 9/30 [00:43<01:33, 4.45s/it]
Best trial: 0. Best value: 0.542971: 30%|### | 9/30 [00:43<01:33, 4.45s/it]
Best trial: 0. Best value: 0.542971: 33%|###3 | 10/30 [00:43<01:14, 3.73s/it]
Best trial: 0. Best value: 0.542971: 33%|###3 | 10/30 [00:48<01:14, 3.73s/it]
Best trial: 0. Best value: 0.542971: 33%|###3 | 10/30 [00:48<01:14, 3.73s/it]
Best trial: 0. Best value: 0.542971: 37%|###6 | 11/30 [00:48<01:23, 4.38s/it]
Best trial: 0. Best value: 0.542971: 37%|###6 | 11/30 [00:51<01:23, 4.38s/it]
Best trial: 11. Best value: 0.550675: 37%|###6 | 11/30 [00:51<01:23, 4.38s/it]
Best trial: 11. Best value: 0.550675: 40%|#### | 12/30 [00:51<01:07, 3.72s/it]
Best trial:
[I 2026-02-09 16:24:14,819] Trial 1 finished with value: 0.5340670335167583 and parameters: {'max_depth': 3, 'learning_rate': 0.030951475185603438, 'n_estimators': 500, 'min_child_weight': 3, 'gamma': 0.42182779857564306, 'subsample': 0.6023273499208519, 'colsample_bytree': 0.797533078753211, 'reg_alpha': 0.2814483439756449, 'reg_lambda': 0.6274701706370918}. Best is trial 0 with value: 0.5429714857428715.
[I 2026-02-09 16:24:20,027] Trial 2 finished with value: 0.5392696348174087 and parameters: {'max_depth': 7, 'learning_rate': 0.06146636789212921, 'n_estimators': 300, 'min_child_weight': 6, 'gamma': 0.25558594382741123, 'subsample': 0.9945002687561844, 'colsample_bytree': 0.7954761585954819, 'reg_alpha': 0.11108714032211087, 'reg_lambda': 1.5745133319617501}. Best is trial 0 with value: 0.5429714857428715.
[I 2026-02-09 16:24:23,283] Trial 3 finished with value: 0.5417708854427213 and parameters: {'max_depth': 3, 'learning_rate': 0.11961166529416824, 'n_estimators': 300, 'min_child_weight': 6, 'gamma': 0.4147872745884843, 'subsample': 0.7452828421445364, 'colsample_bytree': 0.7564990093583203, 'reg_alpha': 0.5128558926741038, 'reg_lambda': 1.7327246508227616}. Best is trial 0 with value: 0.5429714857428715.
[I 2026-02-09 16:24:30,450] Trial 4 finished with value: 0.5281640820410205 and parameters: {'max_depth': 7, 'learning_rate': 0.04926402372255225, 'n_estimators': 400, 'min_child_weight': 6, 'gamma': 0.04586987849413138, 'subsample': 0.9239770916878041, 'colsample_bytree': 0.8138824487747949, 'reg_alpha': 0.12820212800374953, 'reg_lambda': 0.46647686049581494}. Best is trial 0 with value: 0.5429714857428715.