[32m2026-02-09 16:27:47.265[0m | [1mINFO    [0m | [36msrc.mt5_connector[0m:[36mconnect[0m:[36m177[0m - [1mConnected to MT5: FinexBisnisSolusi-Demo (Account: 61045904)[0m
[32m2026-02-09 16:27:47.976[0m | [34m[1mDEBUG   [0m | [36msrc.mt5_connector[0m:[36mget_market_data[0m:[36m449[0m - [34m[1mFetched 50000 bars for XAUUSD M15[0m
[32m2026-02-09 16:27:48.180[0m | [34m[1mDEBUG   [0m | [36msrc.mt5_connector[0m:[36mget_market_data[0m:[36m449[0m - [34m[1mFetched 2000 bars for XAUUSD H1[0m
[32m2026-02-09 16:27:48.188[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_rsi[0m:[36m130[0m - [34m[1mRSI calculated (period=14)[0m
[32m2026-02-09 16:27:48.195[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_atr[0m:[36m185[0m - [34m[1mATR calculated (period=14)[0m
[32m2026-02-09 16:27:48.197[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_macd[0m:[36m243[0m - [34m[1mMACD calculated (12/26/9)[0m
[32m2026-02-09 16:27:48.200[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_bollinger_bands[0m:[36m301[0m - [34m[1mBollinger Bands calculated (period=20, std=2.0)[0m
[32m2026-02-09 16:27:48.203[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_ema_crossover[0m:[36m357[0m - [34m[1mEMA crossover calculated (9/21)[0m
[32m2026-02-09 16:27:48.205[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_volume_features[0m:[36m403[0m - [34m[1mVolume features calculated (period=20)[0m
[32m2026-02-09 16:27:48.214[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_ml_features[0m:[36m518[0m - [34m[1mML features calculated[0m
[32m2026-02-09 16:27:48.218[0m | [34m[1mDEBUG   [0m | [36msrc.smc_polars[0m:[36mcalculate_swing_points[0m:[36m401[0m - [34m[1mSwing points: 3062 highs, 3079 lows[0m
[32m2026-02-09 16:27:48.220[0m | [34m[1mDEBUG   [0m | [36msrc.smc_polars[0m:[36mcalculate_fvg[0m:[36m312[0m - [34m[1mFVG calculation complete. Bullish: 5696, Bearish: 4720[0m
[32m2026-02-09 16:27:48.242[0m | [34m[1mDEBUG   [0m | [36msrc.smc_polars[0m:[36mcalculate_order_blocks[0m:[36m511[0m - [34m[1mOrder Blocks: 2201 bullish, 2164 bearish[0m
[32m2026-02-09 16:27:48.364[0m | [34m[1mDEBUG   [0m | [36msrc.smc_polars[0m:[36mcalculate_bos_choch[0m:[36m599[0m - [34m[1mBOS: 702 bullish, 458 bearish[0m
[32m2026-02-09 16:27:48.364[0m | [34m[1mDEBUG   [0m | [36msrc.smc_polars[0m:[36mcalculate_bos_choch[0m:[36m600[0m - [34m[1mCHoCH: 616 bullish, 617 bearish[0m
[32m2026-02-09 16:27:48.366[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_rsi[0m:[36m130[0m - [34m[1mRSI calculated (period=14)[0m
[32m2026-02-09 16:27:48.367[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_atr[0m:[36m185[0m - [34m[1mATR calculated (period=14)[0m
[32m2026-02-09 16:27:48.368[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_macd[0m:[36m243[0m - [34m[1mMACD calculated (12/26/9)[0m
[32m2026-02-09 16:27:48.369[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_bollinger_bands[0m:[36m301[0m - [34m[1mBollinger Bands calculated (period=20, std=2.0)[0m
[32m2026-02-09 16:27:48.370[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_ema_crossover[0m:[36m357[0m - [34m[1mEMA crossover calculated (9/21)[0m
[32m2026-02-09 16:27:48.371[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_volume_features[0m:[36m403[0m - [34m[1mVolume features calculated (period=20)[0m
[32m2026-02-09 16:27:48.373[0m | [34m[1mDEBUG   [0m | [36msrc.smc_polars[0m:[36mcalculate_swing_points[0m:[36m401[0m - [34m[1mSwing points: 130 highs, 130 lows[0m
[32m2026-02-09 16:27:48.374[0m | [34m[1mDEBUG   [0m | [36msrc.smc_polars[0m:[36mcalculate_fvg[0m:[36m312[0m - [34m[1mFVG calculation complete. Bullish: 256, Bearish: 155[0m
[32m2026-02-09 16:27:48.376[0m | [34m[1mDEBUG   [0m | [36msrc.smc_polars[0m:[36mcalculate_order_blocks[0m:[36m511[0m - [34m[1mOrder Blocks: 90 bullish, 82 bearish[0m
[32m2026-02-09 16:27:48.381[0m | [34m[1mDEBUG   [0m | [36msrc.smc_polars[0m:[36mcalculate_bos_choch[0m:[36m599[0m - [34m[1mBOS: 39 bullish, 20 bearish[0m
[32m2026-02-09 16:27:48.381[0m | [34m[1mDEBUG   [0m | [36msrc.smc_polars[0m:[36mcalculate_bos_choch[0m:[36m600[0m - [34m[1mCHoCH: 19 bullish, 19 bearish[0m
[I 2026-02-09 16:27:48,582] 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:02<?, ?it/s]
Best trial: 0. Best value: 0.547474:   0%|          | 0/30 [00:02<?, ?it/s]
Best trial: 0. Best value: 0.547474:   3%|3         | 1/30 [00:02<01:08,  2.37s/it]
                                                                                   

Best trial: 0. Best value: 0.547474:   3%|3         | 1/30 [00:09<01:08,  2.37s/it]
Best trial: 0. Best value: 0.547474:   3%|3         | 1/30 [00:09<01:08,  2.37s/it]
Best trial: 0. Best value: 0.547474:   7%|6         | 2/30 [00:09<02:17,  4.91s/it]
                                                                                   

Best trial: 0. Best value: 0.547474:   7%|6         | 2/30 [00:12<02:17,  4.91s/it]
Best trial: 0. Best value: 0.547474:   7%|6         | 2/30 [00:12<02:17,  4.91s/it]
Best trial: 0. Best value: 0.547474:  10%|#         | 3/30 [00:12<01:54,  4.23s/it]
                                                                                   

Best trial: 0. Best value: 0.547474:  10%|#         | 3/30 [00:16<01:54,  4.23s/it]
Best trial: 0. Best value: 0.547474:  10%|#         | 3/30 [00:16<01:54,  4.23s/it]
Best trial: 0. Best value: 0.547474:  13%|#3        | 4/30 [00:16<01:44,  4.02s/it]
                                                                                   

Best trial: 0. Best value: 0.547474:  13%|#3        | 4/30 [00:24<01:44,  4.02s/it]
Best trial: 0. Best value: 0.547474:  13%|#3        | 4/30 [00:24<01:44,  4.02s/it]
Best trial: 0. Best value: 0.547474:  17%|#6        | 5/30 [00:24<02:18,  5.52s/it]
                                                                                   

Best trial: 0. Best value: 0.547474:  17%|#6        | 5/30 [00:29<02:18,  5.52s/it]
Best trial: 0. Best value: 0.547474:  17%|#6        | 5/30 [00:29<02:18,  5.52s/it]
Best trial: 0. Best value: 0.547474:  20%|##        | 6/30 [00:29<02:05,  5.24s/it]
                                                                                   

Best trial: 0. Best value: 0.547474:  20%|##        | 6/30 [00:31<02:05,  5.24s/it]
Best trial: 0. Best value: 0.547474:  20%|##        | 6/30 [00:31<02:05,  5.24s/it]
Best trial: 0. Best value: 0.547474:  23%|##3       | 7/30 [00:31<01:37,  4.22s/it]
                                                                                   

Best trial: 0. Best value: 0.547474:  23%|##3       | 7/30 [00:36<01:37,  4.22s/it]
Best trial: 0. Best value: 0.547474:  23%|##3       | 7/30 [00:36<01:37,  4.22s/it]
Best trial: 0. Best value: 0.547474:  27%|##6       | 8/30 [00:36<01:37,  4.43s/it]
                                                                                   

Best trial: 0. Best value: 0.547474:  27%|##6       | 8/30 [00:39<01:37,  4.43s/it]
Best trial: 0. Best value: 0.547474:  27%|##6       | 8/30 [00:39<01:37,  4.43s/it]
Best trial: 0. Best value: 0.547474:  30%|###       | 9/30 [00:39<01:23,  3.97s/it]
                                                                                   

Best trial: 0. Best value: 0.547474:  30%|###       | 9/30 [00:40<01:23,  3.97s/it]
Best trial: 0. Best value: 0.547474:  30%|###       | 9/30 [00:40<01:23,  3.97s/it]
Best trial: 0. Best value: 0.547474:  33%|###3      | 10/30 [00:40<01:04,  3.25s/it]
                                                                                    

Best trial: 0. Best value: 0.547474:  33%|###3      | 10/30 [00:45<01:04,  3.25s/it]
Best trial: 0. Best value: 0.547474:  33%|###3      | 10/30 [00:45<01:04,  3.25s/it]
Best trial: 0. Best value: 0.547474:  37%|###6      | 11/30 [00:45<01:09,  3.65s/it]
                                                                                    

Best trial: 0. Best value: 0.547474:  37%|###6      | 11/30 [00:47<01:09,  3.65s/it]
Best trial: 11. Best value: 0.553777:  37%|###6      | 11/30 [00:47<01:09,  3.65s/it]
Best trial: 11. Best value: 0.553777:  40%|####      | 12/30 [00:47<00:59,  3.28s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  40%|####      | 12/30 [00:51<00:59,  3.28s/it]
Best trial: 11. Best value: 0.553777:  40%|####      | 12/30 [00:51<00:59,  3.28s/it]
Best trial: 11. Best value: 0.553777:  43%|####3     | 13/30 [00:51<00:58,  3.42s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  43%|####3     | 13/30 [00:53<00:58,  3.42s/it]
Best trial: 11. Best value: 0.553777:  43%|####3     | 13/30 [00:53<00:58,  3.42s/it]
Best trial: 11. Best value: 0.553777:  47%|####6     | 14/30 [00:53<00:49,  3.10s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  47%|####6     | 14/30 [00:57<00:49,  3.10s/it]
Best trial: 11. Best value: 0.553777:  47%|####6     | 14/30 [00:57<00:49,  3.10s/it]
Best trial: 11. Best value: 0.553777:  50%|#####     | 15/30 [00:57<00:50,  3.36s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  50%|#####     | 15/30 [00:59<00:50,  3.36s/it]
Best trial: 11. Best value: 0.553777:  50%|#####     | 15/30 [00:59<00:50,  3.36s/it]
Best trial: 11. Best value: 0.553777:  53%|#####3    | 16/30 [00:59<00:41,  2.99s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  53%|#####3    | 16/30 [01:03<00:41,  2.99s/it]
Best trial: 11. Best value: 0.553777:  53%|#####3    | 16/30 [01:03<00:41,  2.99s/it]
Best trial: 11. Best value: 0.553777:  57%|#####6    | 17/30 [01:03<00:40,  3.09s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  57%|#####6    | 17/30 [01:07<00:40,  3.09s/it]
Best trial: 11. Best value: 0.553777:  57%|#####6    | 17/30 [01:07<00:40,  3.09s/it]
Best trial: 11. Best value: 0.553777:  60%|######    | 18/30 [01:07<00:41,  3.46s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  60%|######    | 18/30 [01:12<00:41,  3.46s/it]
Best trial: 11. Best value: 0.553777:  60%|######    | 18/30 [01:12<00:41,  3.46s/it]
Best trial: 11. Best value: 0.553777:  63%|######3   | 19/30 [01:12<00:41,  3.80s/it]
                                                                                     
[I 2026-02-09 16:27:50,948] Trial 0 finished with value: 0.5474737368684343 and parameters: {'max_depth': 3, 'learning_rate': 0.013444796683311491, 'n_estimators': 250, 'min_child_weight': 3, 'gamma': 0.48579673384354716, 'subsample': 0.6767894651898623, 'colsample_bytree': 0.6317893703145389, 'reg_alpha': 0.5643494554652735, 'reg_lambda': 0.7452447389836796}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:27:57,647] Trial 1 finished with value: 0.5343671835917959 and parameters: {'max_depth': 8, 'learning_rate': 0.04684557696902089, 'n_estimators': 300, 'min_child_weight': 2, 'gamma': 0.4194350453349966, 'subsample': 0.6517066517704734, 'colsample_bytree': 0.7819971482514074, 'reg_alpha': 0.830041199695499, 'reg_lambda': 0.3915565756616832}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:28:01,061] Trial 2 finished with value: 0.5439719859929965 and parameters: {'max_depth': 5, 'learning_rate': 0.0322219645174142, 'n_estimators': 300, 'min_child_weight': 3, 'gamma': 0.3737110190517914, 'subsample': 0.8503065428617587, 'colsample_bytree': 0.827860423844928, 'reg_alpha': 0.5337518241589435, 'reg_lambda': 1.4934341263796274}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:28:04,760] Trial 3 finished with value: 0.5370685342671335 and parameters: {'max_depth': 8, 'learning_rate': 0.12837985822395526, 'n_estimators': 150, 'min_child_weight': 2, 'gamma': 0.3183368267558727, 'subsample': 0.7113014524217577, 'colsample_bytree': 0.8019098234261764, 'reg_alpha': 0.11893114768154034, 'reg_lambda': 0.012979060425007738}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:28:12,953] Trial 4 finished with value: 0.5407703851925963 and parameters: {'max_depth': 7, 'learning_rate': 0.04991893091905538, 'n_estimators': 400, 'min_child_weight': 4, 'gamma': 0.10019201984587961, 'subsample': 0.8706325555279136, 'colsample_bytree': 0.944327464169095, 'reg_alpha': 0.6308715629967543, 'reg_lambda': 0.8681392318761993}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:28:17,632] Trial 5 finished with value: 0.5469734867433717 and parameters: {'max_depth': 6, 'learning_rate': 0.060774452949914445, 'n_estimators': 250, 'min_child_weight': 1, 'gamma': 0.3949584233180849, 'subsample': 0.6862347370595067, 'colsample_bytree': 0.8930142045235738, 'reg_alpha': 0.49254928648868024, 'reg_lambda': 1.241681259453201}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:28:19,752] Trial 6 finished with value: 0.5423711855927964 and parameters: {'max_depth': 6, 'learning_rate': 0.03277458860578623, 'n_estimators': 100, 'min_child_weight': 1, 'gamma': 0.49318575684812316, 'subsample': 0.8775683195381774, 'colsample_bytree': 0.7754976094255902, 'reg_alpha': 0.2463653157010871, 'reg_lambda': 0.3435964886367906}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:28:24,637] Trial 7 finished with value: 0.5350675337668834 and parameters: {'max_depth': 6, 'learning_rate': 0.16347560912902231, 'n_estimators': 250, 'min_child_weight': 1, 'gamma': 0.12442943711679733, 'subsample': 0.8309191191901645, 'colsample_bytree': 0.8970536046892863, 'reg_alpha': 0.47905681278645906, 'reg_lambda': 0.04896481154965815}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:28:27,589] Trial 8 finished with value: 0.535167583791896 and parameters: {'max_depth': 6, 'learning_rate': 0.03760992315594353, 'n_estimators': 150, 'min_child_weight': 2, 'gamma': 0.2594481533952627, 'subsample': 0.9520234408652808, 'colsample_bytree': 0.6629688308249894, 'reg_alpha': 0.5766109422456275, 'reg_lambda': 0.3773345233016481}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:28:29,217] Trial 9 finished with value: 0.535767883941971 and parameters: {'max_depth': 4, 'learning_rate': 0.0709104181166301, 'n_estimators': 100, 'min_child_weight': 3, 'gamma': 0.28934571946000287, 'subsample': 0.6869491010445831, 'colsample_bytree': 0.9430842224753117, 'reg_alpha': 0.7436867800229581, 'reg_lambda': 0.9847559665274832}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:28:33,778] Trial 10 finished with value: 0.5424712356178089 and parameters: {'max_depth': 3, 'learning_rate': 0.010783033101275586, 'n_estimators': 500, 'min_child_weight': 7, 'gamma': 0.009371968779573109, 'subsample': 0.6029543274605981, 'colsample_bytree': 0.6089413403372741, 'reg_alpha': 0.9164181480561461, 'reg_lambda': 1.9831756878808429}. Best is trial 0 with value: 0.5474737368684343.
[I 2026-02-09 16:28:36,224] Trial 11 finished with value: 0.5537768884442221 and parameters: {'max_depth': 3, 'learning_rate': 0.011452280183319922, 'n_estimators': 250, 'min_child_weight': 6, 'gamma': 0.49453001024066234, 'subsample': 0.7582472018180934, 'colsample_bytree': 0.7016083942319851, 'reg_alpha': 0.35408510369349555, 'reg_lambda': 1.330102262578806}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:28:39,969] Trial 12 finished with value: 0.5435717858929465 and parameters: {'max_depth': 3, 'learning_rate': 0.010185296687665968, 'n_estimators': 400, 'min_child_weight': 6, 'gamma': 0.4988626877570514, 'subsample': 0.7616798419251574, 'colsample_bytree': 0.6991053197380174, 'reg_alpha': 0.28787849457029985, 'reg_lambda': 1.5136994632371636}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:28:42,338] Trial 13 finished with value: 0.5435717858929465 and parameters: {'max_depth': 4, 'learning_rate': 0.01745225408446133, 'n_estimators': 200, 'min_child_weight': 5, 'gamma': 0.4459927789068112, 'subsample': 0.7486612513206885, 'colsample_bytree': 0.7007670835960189, 'reg_alpha': 0.30920589543578375, 'reg_lambda': 0.7353661975656391}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:28:46,306] Trial 14 finished with value: 0.5376688344172086 and parameters: {'max_depth': 4, 'learning_rate': 0.018736575251357992, 'n_estimators': 350, 'min_child_weight': 5, 'gamma': 0.19273411355241687, 'subsample': 0.7761452041086306, 'colsample_bytree': 0.6058179119267106, 'reg_alpha': 0.007637038641705007, 'reg_lambda': 1.3417483870267253}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:28:48,417] Trial 15 finished with value: 0.5471735867933967 and parameters: {'max_depth': 3, 'learning_rate': 0.019164302285228897, 'n_estimators': 200, 'min_child_weight': 7, 'gamma': 0.3262411732878898, 'subsample': 0.6469624589212517, 'colsample_bytree': 0.7217778596800809, 'reg_alpha': 0.4013319172691523, 'reg_lambda': 1.8656649193621424}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:28:51,736] Trial 16 finished with value: 0.5437718859429714 and parameters: {'max_depth': 5, 'learning_rate': 0.013971817133133538, 'n_estimators': 250, 'min_child_weight': 5, 'gamma': 0.45413166758056167, 'subsample': 0.8067003278188435, 'colsample_bytree': 0.6588443866171148, 'reg_alpha': 0.6831407157545727, 'reg_lambda': 0.595903462185554}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:28:56,063] Trial 17 finished with value: 0.5411705852926463 and parameters: {'max_depth': 4, 'learning_rate': 0.02220687239431731, 'n_estimators': 350, 'min_child_weight': 4, 'gamma': 0.3704123859038717, 'subsample': 0.7227440440244172, 'colsample_bytree': 0.7316020332294502, 'reg_alpha': 0.36892256526000866, 'reg_lambda': 1.1621621985687811}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:29:00,639] Trial 18 finished with value: 0.5445722861430715 and parameters: {'max_depth': 3, 'learning_rate': 0.013131086513497028, 'n_estimators': 500, 'min_child_weight': 6, 'gamma': 0.21472247739219702, 'subsample': 0.9257962275269749, 'colsample_bytree': 0.6550449038177284, 'reg_alpha': 0.17119670655496783, 'reg_lambda': 1.6305585260586144}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:29:04,014] Trial 19 finished with value: 0.5309654827413707 and parameters: {'max_depth': 5, 'learning_rate': 0.025348537846391062, 'n_estimators': 200, 'min_child_weight': 3, 'gamma': 0.49903746452543396, 'subsample': 0.6114872384152402, 'colsample_bytree': 0.748433102245688, 'reg_alpha': 0.42112857950418076, 'reg_lambda': 1.1441844312155283}. Best is trial 11 with value: 0.5537768884442221.
Best trial: 11. Best value: 0.553777:  63%|######3   | 19/30 [01:15<00:41,  3.80s/it]
Best trial: 11. Best value: 0.553777:  63%|######3   | 19/30 [01:15<00:41,  3.80s/it]
Best trial: 11. Best value: 0.553777:  67%|######6   | 20/30 [01:15<00:36,  3.67s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  67%|######6   | 20/30 [01:18<00:36,  3.67s/it]
Best trial: 11. Best value: 0.553777:  67%|######6   | 20/30 [01:18<00:36,  3.67s/it]
Best trial: 11. Best value: 0.553777:  70%|#######   | 21/30 [01:18<00:31,  3.53s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  70%|#######   | 21/30 [01:20<00:31,  3.53s/it]
Best trial: 11. Best value: 0.553777:  70%|#######   | 21/30 [01:20<00:31,  3.53s/it]
Best trial: 11. Best value: 0.553777:  73%|#######3  | 22/30 [01:20<00:25,  3.15s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  73%|#######3  | 22/30 [01:23<00:25,  3.15s/it]
Best trial: 11. Best value: 0.553777:  73%|#######3  | 22/30 [01:23<00:25,  3.15s/it]
Best trial: 11. Best value: 0.553777:  77%|#######6  | 23/30 [01:23<00:21,  3.05s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  77%|#######6  | 23/30 [01:25<00:21,  3.05s/it]
Best trial: 11. Best value: 0.553777:  77%|#######6  | 23/30 [01:25<00:21,  3.05s/it]
Best trial: 11. Best value: 0.553777:  80%|########  | 24/30 [01:25<00:16,  2.71s/it]
                                                                                     

Best trial: 11. Best value: 0.553777:  80%|########  | 24/30 [01:28<00:16,  2.71s/it]
Best trial: 24. Best value: 0.558279:  80%|########  | 24/30 [01:28<00:16,  2.71s/it]
Best trial: 24. Best value: 0.558279:  83%|########3 | 25/30 [01:28<00:13,  2.61s/it]
                                                                                     

Best trial: 24. Best value: 0.558279:  83%|########3 | 25/30 [01:30<00:13,  2.61s/it]
Best trial: 24. Best value: 0.558279:  83%|########3 | 25/30 [01:30<00:13,  2.61s/it]
Best trial: 24. Best value: 0.558279:  87%|########6 | 26/30 [01:30<00:10,  2.57s/it]
                                                                                     

Best trial: 24. Best value: 0.558279:  87%|########6 | 26/30 [01:32<00:10,  2.57s/it]
Best trial: 26. Best value: 0.563782:  87%|########6 | 26/30 [01:32<00:10,  2.57s/it]
Best trial: 26. Best value: 0.563782:  90%|######### | 27/30 [01:32<00:07,  2.38s/it]
                                                                                     

Best trial: 26. Best value: 0.563782:  90%|######### | 27/30 [01:34<00:07,  2.38s/it]
Best trial: 26. Best value: 0.563782:  90%|######### | 27/30 [01:34<00:07,  2.38s/it]
Best trial: 26. Best value: 0.563782:  93%|#########3| 28/30 [01:34<00:04,  2.23s/it]
                                                                                     

Best trial: 26. Best value: 0.563782:  93%|#########3| 28/30 [01:36<00:04,  2.23s/it]
Best trial: 28. Best value: 0.565183:  93%|#########3| 28/30 [01:36<00:04,  2.23s/it]
Best trial: 28. Best value: 0.565183:  97%|#########6| 29/30 [01:36<00:02,  2.21s/it]
                                                                                     

Best trial: 28. Best value: 0.565183:  97%|#########6| 29/30 [01:38<00:02,  2.21s/it]
Best trial: 28. Best value: 0.565183:  97%|#########6| 29/30 [01:38<00:02,  2.21s/it]
Best trial: 28. Best value: 0.565183: 100%|##########| 30/30 [01:38<00:00,  2.23s/it]
Best trial: 28. Best value: 0.565183: 100%|##########| 30/30 [01:38<00:00,  3.29s/it]

[I 2026-02-09 16:29:07,219] Trial 20 finished with value: 0.5458729364682341 and parameters: {'max_depth': 3, 'learning_rate': 0.013402641570172165, 'n_estimators': 350, 'min_child_weight': 4, 'gamma': 0.43653745352147083, 'subsample': 0.9927515481721902, 'colsample_bytree': 0.6357446444860201, 'reg_alpha': 0.9978894370119553, 'reg_lambda': 0.6946103340590695}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:29:09,485] Trial 21 finished with value: 0.5508754377188594 and parameters: {'max_depth': 3, 'learning_rate': 0.016486329829415735, 'n_estimators': 200, 'min_child_weight': 7, 'gamma': 0.32648632433804325, 'subsample': 0.6437235099983806, 'colsample_bytree': 0.7028502979274761, 'reg_alpha': 0.400816028101301, 'reg_lambda': 1.8647667819397633}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:29:12,294] Trial 22 finished with value: 0.5460730365182591 and parameters: {'max_depth': 4, 'learning_rate': 0.015210095840558588, 'n_estimators': 250, 'min_child_weight': 6, 'gamma': 0.3470589000530365, 'subsample': 0.6577062743757138, 'colsample_bytree': 0.682539923042497, 'reg_alpha': 0.6006343283457639, 'reg_lambda': 1.7189885735462773}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:29:14,227] Trial 23 finished with value: 0.5420710355177589 and parameters: {'max_depth': 3, 'learning_rate': 0.025184784429422295, 'n_estimators': 150, 'min_child_weight': 7, 'gamma': 0.40867016046246213, 'subsample': 0.7310711790928597, 'colsample_bytree': 0.6284898464887402, 'reg_alpha': 0.18846461611826393, 'reg_lambda': 0.9651339787500288}. Best is trial 11 with value: 0.5537768884442221.
[I 2026-02-09 16:29:16,601] Trial 24 finished with value: 0.5582791395697849 and parameters: {'max_depth': 4, 'learning_rate': 0.010011504655044785, 'n_estimators': 200, 'min_child_weight': 6, 'gamma': 0.46181147038302783, 'subsample': 0.6903468035734743, 'colsample_bytree': 0.8436171976602074, 'reg_alpha': 0.44457893365715007, 'reg_lambda': 1.7870384723587178}. Best is trial 24 with value: 0.5582791395697849.
[I 2026-02-09 16:29:19,083] Trial 25 finished with value: 0.5565782891445723 and parameters: {'max_depth': 4, 'learning_rate': 0.011918951556509459, 'n_estimators': 200, 'min_child_weight': 6, 'gamma': 0.45541805302891575, 'subsample': 0.7884682950753226, 'colsample_bytree': 0.8348541687022446, 'reg_alpha': 0.3491921571182419, 'reg_lambda': 1.8459041384728796}. Best is trial 24 with value: 0.5582791395697849.
[I 2026-02-09 16:29:20,999] Trial 26 finished with value: 0.5637818909454727 and parameters: {'max_depth': 4, 'learning_rate': 0.010057228241176514, 'n_estimators': 150, 'min_child_weight': 6, 'gamma': 0.43968924121369946, 'subsample': 0.7916092021840972, 'colsample_bytree': 0.8457105975273553, 'reg_alpha': 0.3394500719103723, 'reg_lambda': 1.7272970964513776}. Best is trial 26 with value: 0.5637818909454727.
[I 2026-02-09 16:29:22,893] Trial 27 finished with value: 0.5336668334167084 and parameters: {'max_depth': 5, 'learning_rate': 0.10220450134624365, 'n_estimators': 100, 'min_child_weight': 5, 'gamma': 0.4442636604691904, 'subsample': 0.793727632608053, 'colsample_bytree': 0.8394130253268248, 'reg_alpha': 0.4603970493041781, 'reg_lambda': 1.7115029223670488}. Best is trial 26 with value: 0.5637818909454727.
[I 2026-02-09 16:29:25,045] Trial 28 finished with value: 0.5651825912956479 and parameters: {'max_depth': 4, 'learning_rate': 0.010464961864203006, 'n_estimators': 150, 'min_child_weight': 6, 'gamma': 0.38212589450521944, 'subsample': 0.8223996421481281, 'colsample_bytree': 0.8719067372606736, 'reg_alpha': 0.061284852974232085, 'reg_lambda': 1.9872716932985643}. Best is trial 28 with value: 0.5651825912956479.
[I 2026-02-09 16:29:27,325] Trial 29 finished with value: 0.5534767383691845 and parameters: {'max_depth': 5, 'learning_rate': 0.011068366664991067, 'n_estimators': 150, 'min_child_weight': 6, 'gamma': 0.38510147898365765, 'subsample': 0.9017479529434463, 'colsample_bytree': 0.8739809250925551, 'reg_alpha': 0.029321539193372714, 'reg_lambda': 1.9824751966707503}. Best is trial 28 with value: 0.5651825912956479.

   Best trial: 28
   Best accuracy: 0.5652

   Training final model with params: {'max_depth': 4, 'learning_rate': 0.010464961864203006, 'n_estimators': 150, 'min_child_weight': 6, 'gamma': 0.38212589450521944, 'subsample': 0.8223996421481281, 'colsample_bytree': 0.8719067372606736, 'reg_alpha': 0.061284852974232085, 'reg_lambda': 1.9872716932985643}

 Model Performance (BINARY):
   Train Accuracy: 0.5778
   Test Accuracy:  0.5642

   Test Set Classification Report (BINARY):
              precision    recall  f1-score   support

        SELL      0.512     0.617     0.559      4484
         BUY      0.626     0.522     0.569      5511

    accuracy                          0.564      9995
   macro avg      0.569     0.569     0.564      9995
weighted avg      0.575     0.564     0.565      9995


   Confusion Matrix:
                Predicted
            SELL   BUY
   SELL     2765  1719
   BUY      2637  2874

 Model saved to: backtests\ml_v3\xgboost_model_v3.pkl
 Metadata saved to: backtests\ml_v3\xgboost_model_v3_metadata.json

================================================================================
 TRAINING COMPLETE
================================================================================
