[32m2026-02-09 16:41:03.671[0m | [1mINFO    [0m | [36msrc.mt5_connector[0m:[36mconnect[0m:[36m177[0m - [1mConnected to MT5: FinexBisnisSolusi-Demo (Account: 61045904)[0m
[32m2026-02-09 16:41:04.381[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:41:04.584[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:41:04.589[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_rsi[0m:[36m130[0m - [34m[1mRSI calculated (period=14)[0m
[32m2026-02-09 16:41:04.593[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_atr[0m:[36m185[0m - [34m[1mATR calculated (period=14)[0m
[32m2026-02-09 16:41:04.595[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_macd[0m:[36m243[0m - [34m[1mMACD calculated (12/26/9)[0m
[32m2026-02-09 16:41:04.598[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:41:04.600[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:41:04.602[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:41:04.610[0m | [34m[1mDEBUG   [0m | [36msrc.feature_eng[0m:[36mcalculate_ml_features[0m:[36m518[0m - [34m[1mML features calculated[0m
[32m2026-02-09 16:41:04.614[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:41:04.616[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:41:04.637[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:41:04.750[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:41:04.750[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:41:04.939[0m | [1mINFO    [0m | [36mbacktests.ml_v2.ml_v2_feature_eng[0m:[36madd_all_v2_features[0m:[36m615[0m - [1mAdding all V2 features (23 new features)...[0m
[32m2026-02-09 16:41:04.942[0m | [34m[1mDEBUG   [0m | [36mbacktests.ml_v2.ml_v2_feature_eng[0m:[36madd_h1_features[0m:[36m233[0m - [34m[1mH1 features added (8 features)[0m
[32m2026-02-09 16:41:04.949[0m | [34m[1mDEBUG   [0m | [36mbacktests.ml_v2.ml_v2_feature_eng[0m:[36madd_continuous_smc_features[0m:[36m410[0m - [34m[1mContinuous SMC features added (7 features)[0m
[32m2026-02-09 16:41:04.952[0m | [34m[1mDEBUG   [0m | [36mbacktests.ml_v2.ml_v2_feature_eng[0m:[36madd_regime_features[0m:[36m497[0m - [34m[1mRegime features added (4 features)[0m
[32m2026-02-09 16:41:04.963[0m | [34m[1mDEBUG   [0m | [36mbacktests.ml_v2.ml_v2_feature_eng[0m:[36madd_price_action_features[0m:[36m593[0m - [34m[1mPrice action features added (4 features)[0m
[32m2026-02-09 16:41:04.964[0m | [1mINFO    [0m | [36mbacktests.ml_v2.ml_v2_feature_eng[0m:[36madd_all_v2_features[0m:[36m643[0m - [1mAll V2 features added (23 total)[0m
[I 2026-02-09 16:41:05,171] 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:30:00 to 2026-02-09 11:30:00

 Fetching 2,000 bars of H1 data...
 Fetched 2,000 H1 bars

 Engineering features...
   M15 technical indicators...
   SMC structure features...
   MLV2 features (H1 + derived)...
 Total features: 85 (MLV2 compatible)
     Columns with nulls: 38
      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:   27557 (55.14%)
   SELL:  22423 (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=22046, SELL=17939
   After:  BUY=17939, SELL=17939
   Total samples: 35878

 Selected 81 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=17939 (50.0%), BUY=17939 (50.0%)
   Running Optuna hyperparameter optimization...

  0%|          | 0/30 [00:00<?, ?it/s]
                                      

  0%|          | 0/30 [00:07<?, ?it/s]
Best trial: 0. Best value: 0.529465:   0%|          | 0/30 [00:07<?, ?it/s]
Best trial: 0. Best value: 0.529465:   3%|3         | 1/30 [00:07<03:50,  7.94s/it]
                                                                                   

Best trial: 0. Best value: 0.529465:   3%|3         | 1/30 [00:10<03:50,  7.94s/it]
Best trial: 1. Best value: 0.550675:   3%|3         | 1/30 [00:10<03:50,  7.94s/it]
Best trial: 1. Best value: 0.550675:   7%|6         | 2/30 [00:10<02:18,  4.94s/it]
                                                                                   

Best trial: 1. Best value: 0.550675:   7%|6         | 2/30 [00:18<02:18,  4.94s/it]
Best trial: 1. Best value: 0.550675:   7%|6         | 2/30 [00:18<02:18,  4.94s/it]
Best trial: 1. Best value: 0.550675:  10%|#         | 3/30 [00:18<02:42,  6.02s/it]
                                                                                   

Best trial: 1. Best value: 0.550675:  10%|#         | 3/30 [00:21<02:42,  6.02s/it]
Best trial: 1. Best value: 0.550675:  10%|#         | 3/30 [00:21<02:42,  6.02s/it]
Best trial: 1. Best value: 0.550675:  13%|#3        | 4/30 [00:21<02:14,  5.17s/it]
                                                                                   

Best trial: 1. Best value: 0.550675:  13%|#3        | 4/30 [00:27<02:14,  5.17s/it]
Best trial: 1. Best value: 0.550675:  13%|#3        | 4/30 [00:27<02:14,  5.17s/it]
Best trial: 1. Best value: 0.550675:  17%|#6        | 5/30 [00:27<02:13,  5.35s/it]
                                                                                   

Best trial: 1. Best value: 0.550675:  17%|#6        | 5/30 [00:31<02:13,  5.35s/it]
Best trial: 1. Best value: 0.550675:  17%|#6        | 5/30 [00:31<02:13,  5.35s/it]
Best trial: 1. Best value: 0.550675:  20%|##        | 6/30 [00:31<01:56,  4.85s/it]
                                                                                   

Best trial: 1. Best value: 0.550675:  20%|##        | 6/30 [00:39<01:56,  4.85s/it]
Best trial: 1. Best value: 0.550675:  20%|##        | 6/30 [00:39<01:56,  4.85s/it]
Best trial: 1. Best value: 0.550675:  23%|##3       | 7/30 [00:39<02:17,  5.96s/it]
                                                                                   

Best trial: 1. Best value: 0.550675:  23%|##3       | 7/30 [00:44<02:17,  5.96s/it]
Best trial: 1. Best value: 0.550675:  23%|##3       | 7/30 [00:44<02:17,  5.96s/it]
Best trial: 1. Best value: 0.550675:  27%|##6       | 8/30 [00:44<02:01,  5.53s/it]
                                                                                   

Best trial: 1. Best value: 0.550675:  27%|##6       | 8/30 [00:49<02:01,  5.53s/it]
Best trial: 1. Best value: 0.550675:  27%|##6       | 8/30 [00:49<02:01,  5.53s/it]
Best trial: 1. Best value: 0.550675:  30%|###       | 9/30 [00:49<01:55,  5.49s/it]
                                                                                   

Best trial: 1. Best value: 0.550675:  30%|###       | 9/30 [00:57<01:55,  5.49s/it]
Best trial: 1. Best value: 0.550675:  30%|###       | 9/30 [00:57<01:55,  5.49s/it]
Best trial: 1. Best value: 0.550675:  33%|###3      | 10/30 [00:57<02:02,  6.15s/it]
                                                                                    

Best trial: 1. Best value: 0.550675:  33%|###3      | 10/30 [00:59<02:02,  6.15s/it]
Best trial: 1. Best value: 0.550675:  33%|###3      | 10/30 [00:59<02:02,  6.15s/it]
Best trial: 1. Best value: 0.550675:  37%|###6      | 11/30 [00:59<01:33,  4.94s/it]
                                                                                    

Best trial: 1. Best value: 0.550675:  37%|###6      | 11/30 [01:01<01:33,  4.94s/it]
Best trial: 11. Best value: 0.575788:  37%|###6      | 11/30 [01:01<01:33,  4.94s/it]
Best trial: 11. Best value: 0.575788:  40%|####      | 12/30 [01:01<01:12,  4.02s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  40%|####      | 12/30 [01:03<01:12,  4.02s/it]
Best trial: 11. Best value: 0.575788:  40%|####      | 12/30 [01:03<01:12,  4.02s/it]
Best trial: 11. Best value: 0.575788:  43%|####3     | 13/30 [01:03<00:56,  3.32s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  43%|####3     | 13/30 [01:04<00:56,  3.32s/it]
Best trial: 11. Best value: 0.575788:  43%|####3     | 13/30 [01:04<00:56,  3.32s/it]
Best trial: 11. Best value: 0.575788:  47%|####6     | 14/30 [01:04<00:44,  2.80s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  47%|####6     | 14/30 [01:07<00:44,  2.80s/it]
Best trial: 11. Best value: 0.575788:  47%|####6     | 14/30 [01:07<00:44,  2.80s/it]
Best trial: 11. Best value: 0.575788:  50%|#####     | 15/30 [01:07<00:41,  2.77s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  50%|#####     | 15/30 [01:09<00:41,  2.77s/it]
Best trial: 11. Best value: 0.575788:  50%|#####     | 15/30 [01:09<00:41,  2.77s/it]
Best trial: 11. Best value: 0.575788:  53%|#####3    | 16/30 [01:09<00:36,  2.64s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  53%|#####3    | 16/30 [01:11<00:36,  2.64s/it]
Best trial: 11. Best value: 0.575788:  53%|#####3    | 16/30 [01:11<00:36,  2.64s/it]
Best trial: 11. Best value: 0.575788:  57%|#####6    | 17/30 [01:11<00:31,  2.41s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  57%|#####6    | 17/30 [01:14<00:31,  2.41s/it]
Best trial: 11. Best value: 0.575788:  57%|#####6    | 17/30 [01:14<00:31,  2.41s/it]
Best trial: 11. Best value: 0.575788:  60%|######    | 18/30 [01:14<00:29,  2.42s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  60%|######    | 18/30 [01:17<00:29,  2.42s/it]
Best trial: 11. Best value: 0.575788:  60%|######    | 18/30 [01:17<00:29,  2.42s/it]
Best trial: 11. Best value: 0.575788:  63%|######3   | 19/30 [01:17<00:30,  2.81s/it]
                                                                                     
[I 2026-02-09 16:41:13,110] Trial 0 finished with value: 0.5294647323661831 and parameters: {'max_depth': 7, 'learning_rate': 0.1596338855723077, 'n_estimators': 500, 'min_child_weight': 7, 'gamma': 0.3854846826090362, 'subsample': 0.7291336666177874, 'colsample_bytree': 0.7377421469326575, 'reg_alpha': 0.1001291021796541, 'reg_lambda': 0.9219645891960639}. Best is trial 0 with value: 0.5294647323661831.
[I 2026-02-09 16:41:15,953] Trial 1 finished with value: 0.5506753376688344 and parameters: {'max_depth': 4, 'learning_rate': 0.011104699960295271, 'n_estimators': 250, 'min_child_weight': 6, 'gamma': 0.07107752227579639, 'subsample': 0.7217406047179442, 'colsample_bytree': 0.7901875082972523, 'reg_alpha': 0.7920246871582022, 'reg_lambda': 1.3270410535411894}. Best is trial 1 with value: 0.5506753376688344.
[I 2026-02-09 16:41:23,259] Trial 2 finished with value: 0.5416708354177089 and parameters: {'max_depth': 8, 'learning_rate': 0.01644868543284585, 'n_estimators': 350, 'min_child_weight': 7, 'gamma': 0.26196450357175805, 'subsample': 0.96204746094791, 'colsample_bytree': 0.7689020454477055, 'reg_alpha': 0.7948930980825308, 'reg_lambda': 0.47339185167530706}. Best is trial 1 with value: 0.5506753376688344.
[I 2026-02-09 16:41:27,123] Trial 3 finished with value: 0.5324662331165583 and parameters: {'max_depth': 5, 'learning_rate': 0.17783419318576252, 'n_estimators': 250, 'min_child_weight': 6, 'gamma': 0.4914444288791405, 'subsample': 0.678855843841311, 'colsample_bytree': 0.9845160527823403, 'reg_alpha': 0.7321244719831005, 'reg_lambda': 0.4392719196813113}. Best is trial 1 with value: 0.5506753376688344.
[I 2026-02-09 16:41:32,806] Trial 4 finished with value: 0.544072036018009 and parameters: {'max_depth': 7, 'learning_rate': 0.04946669879429059, 'n_estimators': 200, 'min_child_weight': 1, 'gamma': 0.3895640616014281, 'subsample': 0.7187764917381976, 'colsample_bytree': 0.8233059497603885, 'reg_alpha': 0.64062433618594, 'reg_lambda': 1.549911295856249}. Best is trial 1 with value: 0.5506753376688344.
[I 2026-02-09 16:41:36,687] Trial 5 finished with value: 0.5487743871935968 and parameters: {'max_depth': 8, 'learning_rate': 0.014824232882693456, 'n_estimators': 100, 'min_child_weight': 5, 'gamma': 0.4732835553194193, 'subsample': 0.8259707170499759, 'colsample_bytree': 0.6539479490698005, 'reg_alpha': 0.05699507601554832, 'reg_lambda': 0.7942902393870044}. Best is trial 1 with value: 0.5506753376688344.
[I 2026-02-09 16:41:44,937] Trial 6 finished with value: 0.5416708354177089 and parameters: {'max_depth': 6, 'learning_rate': 0.039845735692153696, 'n_estimators': 400, 'min_child_weight': 1, 'gamma': 0.12284653351511776, 'subsample': 0.7203709866992581, 'colsample_bytree': 0.6594998332873382, 'reg_alpha': 0.3992153643123929, 'reg_lambda': 1.0642625395951688}. Best is trial 1 with value: 0.5506753376688344.
[I 2026-02-09 16:41:49,550] Trial 7 finished with value: 0.5360680340170085 and parameters: {'max_depth': 5, 'learning_rate': 0.04388062331748783, 'n_estimators': 300, 'min_child_weight': 6, 'gamma': 0.0867589447407715, 'subsample': 0.7904642607757544, 'colsample_bytree': 0.9345910284177743, 'reg_alpha': 0.9044982369354854, 'reg_lambda': 1.389259391153311}. Best is trial 1 with value: 0.5506753376688344.
[I 2026-02-09 16:41:54,928] Trial 8 finished with value: 0.5400700350175087 and parameters: {'max_depth': 5, 'learning_rate': 0.07855791940705616, 'n_estimators': 400, 'min_child_weight': 7, 'gamma': 0.468069256749748, 'subsample': 0.7426692017021324, 'colsample_bytree': 0.7342867357672963, 'reg_alpha': 0.19029635762640107, 'reg_lambda': 1.2696557246275553}. Best is trial 1 with value: 0.5506753376688344.
[I 2026-02-09 16:42:02,557] Trial 9 finished with value: 0.5319659829914958 and parameters: {'max_depth': 6, 'learning_rate': 0.18008854483391323, 'n_estimators': 450, 'min_child_weight': 7, 'gamma': 0.050571947849996524, 'subsample': 0.9563227246283372, 'colsample_bytree': 0.8689613073959465, 'reg_alpha': 0.4710586084741383, 'reg_lambda': 0.1000342329524877}. Best is trial 1 with value: 0.5506753376688344.
[I 2026-02-09 16:42:04,746] Trial 10 finished with value: 0.5482741370685342 and parameters: {'max_depth': 3, 'learning_rate': 0.023773132475983852, 'n_estimators': 150, 'min_child_weight': 3, 'gamma': 0.18265713181074789, 'subsample': 0.6047249952041318, 'colsample_bytree': 0.8727254102367645, 'reg_alpha': 0.8942699775087375, 'reg_lambda': 1.8655568321038314}. Best is trial 1 with value: 0.5506753376688344.
[I 2026-02-09 16:42:06,660] Trial 11 finished with value: 0.5757878939469735 and parameters: {'max_depth': 3, 'learning_rate': 0.010021000782285981, 'n_estimators': 100, 'min_child_weight': 4, 'gamma': 0.273337794602624, 'subsample': 0.8567843664845207, 'colsample_bytree': 0.621240422340262, 'reg_alpha': 0.003935022800336703, 'reg_lambda': 0.8064710239285696}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:08,365] Trial 12 finished with value: 0.5727863931965983 and parameters: {'max_depth': 3, 'learning_rate': 0.010047785741825377, 'n_estimators': 100, 'min_child_weight': 3, 'gamma': 0.25741280547358164, 'subsample': 0.8689366412488836, 'colsample_bytree': 0.6196469042388145, 'reg_alpha': 0.36039923523084805, 'reg_lambda': 1.6776809075404149}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:09,979] Trial 13 finished with value: 0.5620810405202601 and parameters: {'max_depth': 3, 'learning_rate': 0.010154376870356816, 'n_estimators': 100, 'min_child_weight': 3, 'gamma': 0.2758796092276785, 'subsample': 0.8830097225095261, 'colsample_bytree': 0.6003756234984219, 'reg_alpha': 0.2897088403870687, 'reg_lambda': 1.8926635300735808}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:12,659] Trial 14 finished with value: 0.5453726863431716 and parameters: {'max_depth': 4, 'learning_rate': 0.022924623986723982, 'n_estimators': 150, 'min_child_weight': 3, 'gamma': 0.18655407259108056, 'subsample': 0.8832873017277937, 'colsample_bytree': 0.6631503540917238, 'reg_alpha': 0.2601314426412809, 'reg_lambda': 0.7333794244603251}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:14,997] Trial 15 finished with value: 0.5458729364682341 and parameters: {'max_depth': 3, 'learning_rate': 0.023320962485499787, 'n_estimators': 150, 'min_child_weight': 4, 'gamma': 0.3230745179918392, 'subsample': 0.8813515000851172, 'colsample_bytree': 0.6046192209773239, 'reg_alpha': 0.5793444023033884, 'reg_lambda': 1.586905358088643}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:16,890] Trial 16 finished with value: 0.552376188094047 and parameters: {'max_depth': 4, 'learning_rate': 0.015152274669888841, 'n_estimators': 100, 'min_child_weight': 2, 'gamma': 0.19350712718939278, 'subsample': 0.8241060458545045, 'colsample_bytree': 0.6835854105015035, 'reg_alpha': 0.006392443934860902, 'reg_lambda': 0.5593803727422066}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:19,332] Trial 17 finished with value: 0.5293646823411706 and parameters: {'max_depth': 3, 'learning_rate': 0.0970256947443904, 'n_estimators': 200, 'min_child_weight': 4, 'gamma': 0.3226498613036859, 'subsample': 0.9227058440182543, 'colsample_bytree': 0.7060148846492967, 'reg_alpha': 0.33968650603189293, 'reg_lambda': 1.0819278748268624}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:23,060] Trial 18 finished with value: 0.5395697848924462 and parameters: {'max_depth': 4, 'learning_rate': 0.03299468900034665, 'n_estimators': 200, 'min_child_weight': 2, 'gamma': 0.22797034457730556, 'subsample': 0.9967802812498777, 'colsample_bytree': 0.6306759869292317, 'reg_alpha': 0.16816760804261416, 'reg_lambda': 0.04050101390455341}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:26,631] Trial 19 finished with value: 0.5482741370685342 and parameters: {'max_depth': 3, 'learning_rate': 0.012768644778620199, 'n_estimators': 300, 'min_child_weight': 5, 'gamma': 0.318296743205217, 'subsample': 0.7888183898461, 'colsample_bytree': 0.7223799602965822, 'reg_alpha': 0.5026257347917665, 'reg_lambda': 1.7319891255846904}. Best is trial 11 with value: 0.5757878939469735.
Best trial: 11. Best value: 0.575788:  63%|######3   | 19/30 [01:21<00:30,  2.81s/it]
Best trial: 11. Best value: 0.575788:  63%|######3   | 19/30 [01:21<00:30,  2.81s/it]
Best trial: 11. Best value: 0.575788:  67%|######6   | 20/30 [01:21<00:30,  3.04s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  67%|######6   | 20/30 [01:23<00:30,  3.04s/it]
Best trial: 11. Best value: 0.575788:  67%|######6   | 20/30 [01:23<00:30,  3.04s/it]
Best trial: 11. Best value: 0.575788:  70%|#######   | 21/30 [01:23<00:24,  2.78s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  70%|#######   | 21/30 [01:25<00:24,  2.78s/it]
Best trial: 11. Best value: 0.575788:  70%|#######   | 21/30 [01:25<00:24,  2.78s/it]
Best trial: 11. Best value: 0.575788:  73%|#######3  | 22/30 [01:25<00:19,  2.48s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  73%|#######3  | 22/30 [01:27<00:19,  2.48s/it]
Best trial: 11. Best value: 0.575788:  73%|#######3  | 22/30 [01:27<00:19,  2.48s/it]
Best trial: 11. Best value: 0.575788:  77%|#######6  | 23/30 [01:27<00:16,  2.41s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  77%|#######6  | 23/30 [01:29<00:16,  2.41s/it]
Best trial: 11. Best value: 0.575788:  77%|#######6  | 23/30 [01:29<00:16,  2.41s/it]
Best trial: 11. Best value: 0.575788:  80%|########  | 24/30 [01:29<00:14,  2.37s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  80%|########  | 24/30 [01:32<00:14,  2.37s/it]
Best trial: 11. Best value: 0.575788:  80%|########  | 24/30 [01:32<00:14,  2.37s/it]
Best trial: 11. Best value: 0.575788:  83%|########3 | 25/30 [01:32<00:11,  2.32s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  83%|########3 | 25/30 [01:34<00:11,  2.32s/it]
Best trial: 11. Best value: 0.575788:  83%|########3 | 25/30 [01:34<00:11,  2.32s/it]
Best trial: 11. Best value: 0.575788:  87%|########6 | 26/30 [01:34<00:09,  2.47s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  87%|########6 | 26/30 [01:38<00:09,  2.47s/it]
Best trial: 11. Best value: 0.575788:  87%|########6 | 26/30 [01:38<00:09,  2.47s/it]
Best trial: 11. Best value: 0.575788:  90%|######### | 27/30 [01:38<00:08,  2.75s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  90%|######### | 27/30 [01:40<00:08,  2.75s/it]
Best trial: 11. Best value: 0.575788:  90%|######### | 27/30 [01:40<00:08,  2.75s/it]
Best trial: 11. Best value: 0.575788:  93%|#########3| 28/30 [01:40<00:05,  2.61s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  93%|#########3| 28/30 [01:42<00:05,  2.61s/it]
Best trial: 11. Best value: 0.575788:  93%|#########3| 28/30 [01:42<00:05,  2.61s/it]
Best trial: 11. Best value: 0.575788:  97%|#########6| 29/30 [01:42<00:02,  2.44s/it]
                                                                                     

Best trial: 11. Best value: 0.575788:  97%|#########6| 29/30 [01:45<00:02,  2.44s/it]
Best trial: 11. Best value: 0.575788:  97%|#########6| 29/30 [01:45<00:02,  2.44s/it]
Best trial: 11. Best value: 0.575788: 100%|##########| 30/30 [01:45<00:00,  2.56s/it]
Best trial: 11. Best value: 0.575788: 100%|##########| 30/30 [01:45<00:00,  3.52s/it]

[I 2026-02-09 16:42:28,794] Trial 20 finished with value: 0.5489744872436219 and parameters: {'max_depth': 4, 'learning_rate': 0.019212043256266662, 'n_estimators': 100, 'min_child_weight': 4, 'gamma': 0.009924090088930804, 'subsample': 0.8464899007710753, 'colsample_bytree': 0.6325062533963053, 'reg_alpha': 0.16610776696642748, 'reg_lambda': 0.2934750267921207}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:30,593] Trial 21 finished with value: 0.5728864432216108 and parameters: {'max_depth': 3, 'learning_rate': 0.010081156011310608, 'n_estimators': 100, 'min_child_weight': 3, 'gamma': 0.2526249142620474, 'subsample': 0.880605146488746, 'colsample_bytree': 0.6090781070852289, 'reg_alpha': 0.2812703173379051, 'reg_lambda': 1.908635197982981}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:32,822] Trial 22 finished with value: 0.5597798899449725 and parameters: {'max_depth': 3, 'learning_rate': 0.010529742045968803, 'n_estimators': 150, 'min_child_weight': 2, 'gamma': 0.13588649597484698, 'subsample': 0.8637729728675068, 'colsample_bytree': 0.6021187390788858, 'reg_alpha': 0.3954843308946087, 'reg_lambda': 1.9762732764487496}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:35,101] Trial 23 finished with value: 0.5626813406703352 and parameters: {'max_depth': 4, 'learning_rate': 0.014132381683897412, 'n_estimators': 100, 'min_child_weight': 3, 'gamma': 0.2344340461360128, 'subsample': 0.9196070347867669, 'colsample_bytree': 0.6914140843856791, 'reg_alpha': 0.24647179022508164, 'reg_lambda': 1.6752258382534415}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:37,319] Trial 24 finished with value: 0.5543771885942972 and parameters: {'max_depth': 3, 'learning_rate': 0.018707261759537713, 'n_estimators': 150, 'min_child_weight': 4, 'gamma': 0.3672489019448627, 'subsample': 0.9208721963962728, 'colsample_bytree': 0.6409237522491804, 'reg_alpha': 0.4183129138530536, 'reg_lambda': 1.4583983807320375}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:40,129] Trial 25 finished with value: 0.535967983991996 and parameters: {'max_depth': 3, 'learning_rate': 0.0303729960302478, 'n_estimators': 200, 'min_child_weight': 5, 'gamma': 0.2888808924918053, 'subsample': 0.7711145164549056, 'colsample_bytree': 0.680998741757501, 'reg_alpha': 0.5486437209436136, 'reg_lambda': 1.1983750934426203}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:43,520] Trial 26 finished with value: 0.5420710355177589 and parameters: {'max_depth': 4, 'learning_rate': 0.012165257426397598, 'n_estimators': 250, 'min_child_weight': 2, 'gamma': 0.2283300551695912, 'subsample': 0.8296045196087075, 'colsample_bytree': 0.629901714204692, 'reg_alpha': 0.0934916889850847, 'reg_lambda': 1.7296959321218166}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:45,825] Trial 27 finished with value: 0.5338669334667334 and parameters: {'max_depth': 5, 'learning_rate': 0.0639204198758616, 'n_estimators': 100, 'min_child_weight': 3, 'gamma': 0.43341886048830325, 'subsample': 0.8993451757827229, 'colsample_bytree': 0.7644448892123876, 'reg_alpha': 0.3205226501809205, 'reg_lambda': 1.9950371521566987}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:47,845] Trial 28 finished with value: 0.5605802901450725 and parameters: {'max_depth': 3, 'learning_rate': 0.01757013301892512, 'n_estimators': 150, 'min_child_weight': 4, 'gamma': 0.16130881262785032, 'subsample': 0.9589406015777211, 'colsample_bytree': 0.670365914973662, 'reg_alpha': 0.1583845669841208, 'reg_lambda': 0.8415622288366071}. Best is trial 11 with value: 0.5757878939469735.
[I 2026-02-09 16:42:50,694] Trial 29 finished with value: 0.5526763381690846 and parameters: {'max_depth': 7, 'learning_rate': 0.011856696585582062, 'n_estimators': 100, 'min_child_weight': 5, 'gamma': 0.35093642134553427, 'subsample': 0.8407975957397448, 'colsample_bytree': 0.7526054565658269, 'reg_alpha': 0.0005877293438121822, 'reg_lambda': 0.9661640907334406}. Best is trial 11 with value: 0.5757878939469735.

   Best trial: 11
   Best accuracy: 0.5758

   Training final model with params: {'max_depth': 3, 'learning_rate': 0.010021000782285981, 'n_estimators': 100, 'min_child_weight': 4, 'gamma': 0.273337794602624, 'subsample': 0.8567843664845207, 'colsample_bytree': 0.621240422340262, 'reg_alpha': 0.003935022800336703, 'reg_lambda': 0.8064710239285696}

 Model Performance (BINARY):
   Train Accuracy: 0.5720
   Test Accuracy:  0.5637

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

        SELL      0.512     0.575     0.542      4484
         BUY      0.616     0.555     0.584      5511

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


   Confusion Matrix:
                Predicted
            SELL   BUY
   SELL     2578  1906
   BUY      2455  3056

 Model saved to: backtests\ml_v3\xgboost_model_v3.pkl (TradingModelV2 format)
 Metadata saved to: backtests\ml_v3\xgboost_model_v3_metadata.json

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