diff --git a/__pycache__/orchestrator.cpython-313.pyc b/__pycache__/orchestrator.cpython-313.pyc index 4abab40..b604ee0 100644 Binary files a/__pycache__/orchestrator.cpython-313.pyc and b/__pycache__/orchestrator.cpython-313.pyc differ diff --git a/config/current_config.json b/config/current_config.json index 2ef9f1d..9ac6e87 100644 --- a/config/current_config.json +++ b/config/current_config.json @@ -1,10 +1,9 @@ { - "model_type": "xgboost", + "model_type": "hybrid", "features": { "technical_indicators": [ "RSI_14", "RSI_7", - "RSI_21", "MACD_line", "MACD_signal", "MACD_hist", @@ -12,23 +11,16 @@ "BB_lower", "BB_width", "ATR_14", - "SMA_5", - "SMA_10", "SMA_20", "SMA_50", - "SMA_200", - "EMA_5", "EMA_10", "EMA_20", - "EMA_50", "OBV", "stoch_k", "stoch_d", "williams_r", "CCI_20", - "ROC_10", - "keltner_upper", - "keltner_lower" + "ROC_10" ], "lookback_periods": [ 3, @@ -38,47 +30,63 @@ ], "use_volume_features": true, "use_volatility_features": true, - "use_candle_patterns": true, + "use_candle_patterns": false, "use_lag_features": true, "lag_periods": [ 1, 2, 3, 5 - ] + ], + "use_pca": true, + "pca_variance": 0.95, + "use_scaler": true }, "target": { "type": "classification", - "direction": "long", - "horizon_candles": 6, - "threshold_pct": 1.5 + "direction": "both", + "horizon_candles": 4, + "threshold_pct": 1.0 }, "hyperparameters": { - "learning_rate": 0.05, - "max_depth": 4, - "n_estimators": 500, + "learning_rate": 0.001, + "max_depth": 5, + "n_estimators": 300, "subsample": 0.8, "colsample_bytree": 0.8, "min_child_weight": 5, - "gamma": 0.1, - "reg_alpha": 0.5, - "reg_lambda": 2.0 + "gamma": 0.3, + "reg_alpha": 0.1, + "reg_lambda": 5.0, + "lstm_hidden_size": 128, + "lstm_num_layers": 2, + "lstm_dropout": 0.3, + "lstm_epochs": 100, + "lstm_batch_size": 64, + "lstm_sequence_length": 20, + "lstm_patience": 10 }, "strategy": { - "entry_threshold": 0.75, + "entry_threshold": 0.65, "exit_type": "trailing_stop", "stop_loss_pct": 2.0, "take_profit_pct": 4.0, "trailing_stop_pct": 1.5, "position_sizing": "confidence_scaled", "max_position_pct": 100, - "min_confidence_to_trade": 0.55 + "min_confidence_to_trade": 0.5, + "dynamic_sl_tp": true, + "atr_sl_multiplier": 1.2, + "atr_tp_multiplier": 3.0 }, "training": { "walk_forward_windows": 5, "train_pct": 0.7, "validation_pct": 0.15, - "test_pct": 0.15 + "test_pct": 0.15, + "rolling_window": true, + "rolling_train_size": 3000, + "rolling_test_size": 200 }, "timeframe": "4h" } \ No newline at end of file diff --git a/config/initial_config.json b/config/initial_config.json index a6c8f19..b6bbe12 100644 --- a/config/initial_config.json +++ b/config/initial_config.json @@ -1,29 +1,44 @@ { - "model_type": "hybrid", + "model_type": "xgboost", "features": { "use_price_position": true, "use_momentum": true, "use_volatility": true, "use_volume": true, "use_cycle": true, - "use_pca": true, + "use_pca": false, "pca_variance": 0.95, "use_scaler": true }, "target": { "type": "regression", - "forward_periods_1h": [168, 720, 2160], - "forward_periods_4h": [42, 180, 540], - "weights": [0.2, 0.3, 0.5], - "score_range": [0, 100] + "forward_periods_1h": [ + 168, + 720, + 2160 + ], + "forward_periods_4h": [ + 42, + 180, + 540 + ], + "weights": [ + 0.2, + 0.3, + 0.5 + ], + "score_range": [ + 0, + 100 + ] }, "hyperparameters": { "learning_rate": 0.01, - "max_depth": 5, - "n_estimators": 500, + "max_depth": 4, + "n_estimators": 300, "subsample": 0.8, "colsample_bytree": 0.8, - "min_child_weight": 10, + "min_child_weight": 20, "gamma": 0.3, "reg_alpha": 0.5, "reg_lambda": 3.0, @@ -36,9 +51,9 @@ "lstm_patience": 10 }, "strategy": { - "strong_buy_threshold": 80, - "good_buy_threshold": 70, - "poor_threshold": 30 + "strong_buy_threshold": 65, + "good_buy_threshold": 55, + "poor_threshold": 35 }, "training": { "rolling_window": true, diff --git a/llm_client/__pycache__/analyzer.cpython-313.pyc b/llm_client/__pycache__/analyzer.cpython-313.pyc index 9e5dfd5..8bf7f7a 100644 Binary files a/llm_client/__pycache__/analyzer.cpython-313.pyc and b/llm_client/__pycache__/analyzer.cpython-313.pyc differ diff --git a/results/iterations.jsonl b/results/iterations.jsonl deleted file mode 100644 index 92f6f7f..0000000 --- a/results/iterations.jsonl +++ /dev/null @@ -1,2 +0,0 @@ -{"iteration": 1, "timestamp": "2026-03-19T22:27:13.722573+00:00", "sharpe": -0.619, "return": -40.57, "max_drawdown": -41.08, "win_rate": 0.279, "trades": 104, "profit_factor": 0.369, "model_type": "xgboost", "is_best": false, "config": {"model_type": "xgboost", "features": {"technical_indicators": ["RSI_14", "RSI_7", "RSI_21", "MACD_line", "MACD_signal", "MACD_hist", "BB_upper", "BB_lower", "BB_width", "ATR_14", "SMA_5", "SMA_10", "SMA_20", "SMA_50", "SMA_200", "EMA_5", "EMA_10", "EMA_20", "EMA_50", "OBV", "stoch_k", "stoch_d", "williams_r", "CCI_20", "ROC_10", "keltner_upper", "keltner_lower"], "lookback_periods": [3, 5, 10, 20], "use_volume_features": true, "use_volatility_features": true, "use_candle_patterns": true, "use_lag_features": true, "lag_periods": [1, 2, 3, 5]}, "target": {"type": "classification", "direction": "long", "horizon_candles": 6, "threshold_pct": 1.0}, "hyperparameters": {"learning_rate": 0.05, "max_depth": 6, "n_estimators": 500, "subsample": 0.8, "colsample_bytree": 0.8, "min_child_weight": 5, "gamma": 0.1, "reg_alpha": 0.1, "reg_lambda": 1.0}, "strategy": {"entry_threshold": 0.6, "exit_type": "trailing_stop", "stop_loss_pct": 2.0, "take_profit_pct": 4.0, "trailing_stop_pct": 1.5, "position_sizing": "confidence_scaled", "max_position_pct": 100, "min_confidence_to_trade": 0.55}, "training": {"walk_forward_windows": 5, "train_pct": 0.7, "validation_pct": 0.15, "test_pct": 0.15}, "timeframe": "4h"}, "results": {"sharpe_ratio": -0.619, "total_return_pct": -40.57, "max_drawdown_pct": -41.08, "win_rate": 0.279, "trade_count": 104, "profit_factor": 0.369, "avg_trade_duration_candles": 3.0, "feature_importances": {"EMA_20": 0.0295, "EMA_5": 0.0232, "OBV": 0.0222, "SMA_200": 0.022, "keltner_upper": 0.0199, "SMA_5": 0.0187, "price_vs_vwap": 0.0186, "RSI_21": 0.0186, "SMA_50": 0.0183, "high_low_range_10": 0.0177, "price_vs_SMA_200": 0.0176, "RSI_14": 0.0175, "EMA_50": 0.0172, "SMA_20": 0.0172, "ATR_pct": 0.0166, "BB_lower": 0.0164, "vwap_approx": 0.0163, "SMA_10": 0.0161, "hist_volatility": 0.0158, "CCI_20": 0.0157, "high_low_range_20": 0.0157, "MACD_signal": 0.0155, "return_5": 0.0155, "MACD_line": 0.0155, "price_vs_SMA_10": 0.0154, "MACD_hist": 0.0154, "price_vs_SMA_50": 0.0149, "return_10": 0.0148, "EMA_10": 0.0147, "BB_width": 0.0147}, "monthly_returns": [-10.9, -2.1, -8.85, 1.24, -3.7, -0.32, -7.86, -7.08, -3.35, -2.22, -2.34, -2.58, -1.06], "equity_curve": [1.0, 0.9835, 0.9619, 0.9407, 0.9279, 0.9075, 0.9043, 0.8954, 0.8959, 0.8942, 0.8794, 0.8649, 0.8808, 0.877, 0.8809, 0.888, 0.8767, 0.8731, 0.8677, 0.8486, 0.8409, 0.8224, 0.8212, 0.8199, 0.8018, 0.7948, 0.7862, 0.8161, 0.8118, 0.8427, 0.8395, 0.8285, 0.8103, 0.7925, 0.7751, 0.7686, 0.7846, 0.7875, 0.788, 0.775, 0.7801, 0.7819, 0.7863, 0.769, 0.7671, 0.7707, 0.7724, 0.7808, 0.7774, 0.7734, 0.7686, 0.765, 0.7529, 0.7443, 0.7356, 0.7304, 0.7183, 0.7254, 0.7164, 0.7007, 0.7096, 0.7026, 0.691, 0.6837, 0.6686, 0.6765, 0.6695, 0.6704, 0.6776, 0.6684, 0.6589, 0.6523, 0.6463, 0.6457, 0.6599, 0.6584, 0.6509, 0.649, 0.6432, 0.6291, 0.6317, 0.6497, 0.6386, 0.6364, 0.6335, 0.63, 0.6196, 0.6176, 0.6166, 0.6159, 0.6182, 0.6115, 0.6156, 0.6159, 0.614, 0.6075, 0.6008, 0.6058, 0.6076, 0.6055, 0.6006, 0.599, 0.5892, 0.5952, 0.5943], "per_window_sharpe": [-2.714, -0.921, -0.39, -1.089, -1.966]}} -{"iteration": 2, "timestamp": "2026-03-19T22:32:18.314965+00:00", "sharpe": -0.546, "return": -18.32, "max_drawdown": -20.98, "win_rate": 0.34, "trades": 53, "profit_factor": 0.542, "model_type": "xgboost", "is_best": false, "config": {"model_type": "xgboost", "features": {"technical_indicators": ["RSI_14", "RSI_7", "RSI_21", "MACD_line", "MACD_signal", "MACD_hist", "BB_upper", "BB_lower", "BB_width", "ATR_14", "SMA_5", "SMA_10", "SMA_20", "SMA_50", "SMA_200", "EMA_5", "EMA_10", "EMA_20", "EMA_50", "OBV", "stoch_k", "stoch_d", "williams_r", "CCI_20", "ROC_10", "keltner_upper", "keltner_lower"], "lookback_periods": [3, 5, 10, 20], "use_volume_features": true, "use_volatility_features": true, "use_candle_patterns": true, "use_lag_features": true, "lag_periods": [1, 2, 3, 5]}, "target": {"type": "classification", "direction": "long", "horizon_candles": 6, "threshold_pct": 1.5}, "hyperparameters": {"learning_rate": 0.05, "max_depth": 4, "n_estimators": 500, "subsample": 0.8, "colsample_bytree": 0.8, "min_child_weight": 5, "gamma": 0.1, "reg_alpha": 0.5, "reg_lambda": 2.0}, "strategy": {"entry_threshold": 0.75, "exit_type": "trailing_stop", "stop_loss_pct": 2.0, "take_profit_pct": 4.0, "trailing_stop_pct": 1.5, "position_sizing": "confidence_scaled", "max_position_pct": 100, "min_confidence_to_trade": 0.55}, "training": {"walk_forward_windows": 5, "train_pct": 0.7, "validation_pct": 0.15, "test_pct": 0.15}, "timeframe": "4h"}, "results": {"sharpe_ratio": -0.546, "total_return_pct": -18.32, "max_drawdown_pct": -20.98, "win_rate": 0.34, "trade_count": 53, "profit_factor": 0.542, "avg_trade_duration_candles": 2.3, "feature_importances": {"EMA_20": 0.0295, "EMA_5": 0.0274, "OBV": 0.0252, "price_vs_SMA_50": 0.0219, "EMA_10": 0.0214, "SMA_200": 0.0207, "return_lag_5": 0.0191, "SMA_5": 0.0189, "vwap_approx": 0.0187, "price_vs_SMA_200": 0.0186, "BB_lower": 0.0181, "SMA_20": 0.0175, "ATR_pct": 0.0174, "keltner_upper": 0.0172, "volume_sma_20": 0.017, "ATR_14": 0.0169, "return_5": 0.0167, "BB_upper": 0.0166, "SMA_50": 0.0164, "RSI_21": 0.0163, "high_low_range_10": 0.0163, "hist_volatility": 0.0163, "high_low_range_20": 0.0163, "EMA_50": 0.0162, "keltner_lower": 0.016, "MACD_hist": 0.0159, "RSI_14_lag_1": 0.0152, "CCI_20": 0.015, "high_low_range_5": 0.015, "volatility_20": 0.0149}, "monthly_returns": [-2.62, -1.95, -4.71, 1.32, -2.8, 1.53, -1.85, -4.51, -2.54, -3.73, 0.01, -1.05, 2.97, 0.31], "equity_curve": [1.0, 0.9952, 0.9921, 0.9767, 0.974, 0.9579, 0.9754, 0.954, 0.9546, 0.9336, 0.9323, 0.9308, 0.9103, 0.9023, 0.8926, 0.9265, 0.9217, 0.9567, 0.9357, 0.9151, 0.8949, 0.8857, 0.8992, 0.9025, 0.9085, 0.9106, 0.9157, 0.8956, 0.8916, 0.8842, 0.8766, 0.8663, 0.852, 0.8467, 0.828, 0.8386, 0.8304, 0.8167, 0.808, 0.7902, 0.7995, 0.7912, 0.7984, 0.8069, 0.7995, 0.8115, 0.8109, 0.8086, 0.7908, 0.7941, 0.8167, 0.8076, 0.8143, 0.8168], "per_window_sharpe": [-2.302, -0.762, -6.981, -0.909, 4.91]}} diff --git a/results/results_iter_1.json b/results/results_iter_1.json deleted file mode 100644 index 661267f..0000000 --- a/results/results_iter_1.json +++ /dev/null @@ -1,170 +0,0 @@ -{ - "sharpe_ratio": -0.619, - "total_return_pct": -40.57, - "max_drawdown_pct": -41.08, - "win_rate": 0.279, - "trade_count": 104, - "profit_factor": 0.369, - "avg_trade_duration_candles": 3.0, - "feature_importances": { - "EMA_20": 0.0295, - "EMA_5": 0.0232, - "OBV": 0.0222, - "SMA_200": 0.022, - "keltner_upper": 0.0199, - "SMA_5": 0.0187, - "price_vs_vwap": 0.0186, - "RSI_21": 0.0186, - "SMA_50": 0.0183, - "high_low_range_10": 0.0177, - "price_vs_SMA_200": 0.0176, - "RSI_14": 0.0175, - "EMA_50": 0.0172, - "SMA_20": 0.0172, - "ATR_pct": 0.0166, - "BB_lower": 0.0164, - "vwap_approx": 0.0163, - "SMA_10": 0.0161, - "hist_volatility": 0.0158, - "CCI_20": 0.0157, - "high_low_range_20": 0.0157, - "MACD_signal": 0.0155, - "return_5": 0.0155, - "MACD_line": 0.0155, - "price_vs_SMA_10": 0.0154, - "MACD_hist": 0.0154, - "price_vs_SMA_50": 0.0149, - "return_10": 0.0148, - "EMA_10": 0.0147, - "BB_width": 0.0147 - }, - "monthly_returns": [ - -10.9, - -2.1, - -8.85, - 1.24, - -3.7, - -0.32, - -7.86, - -7.08, - -3.35, - -2.22, - -2.34, - -2.58, - -1.06 - ], - "equity_curve": [ - 1.0, - 0.9835, - 0.9619, - 0.9407, - 0.9279, - 0.9075, - 0.9043, - 0.8954, - 0.8959, - 0.8942, - 0.8794, - 0.8649, - 0.8808, - 0.877, - 0.8809, - 0.888, - 0.8767, - 0.8731, - 0.8677, - 0.8486, - 0.8409, - 0.8224, - 0.8212, - 0.8199, - 0.8018, - 0.7948, - 0.7862, - 0.8161, - 0.8118, - 0.8427, - 0.8395, - 0.8285, - 0.8103, - 0.7925, - 0.7751, - 0.7686, - 0.7846, - 0.7875, - 0.788, - 0.775, - 0.7801, - 0.7819, - 0.7863, - 0.769, - 0.7671, - 0.7707, - 0.7724, - 0.7808, - 0.7774, - 0.7734, - 0.7686, - 0.765, - 0.7529, - 0.7443, - 0.7356, - 0.7304, - 0.7183, - 0.7254, - 0.7164, - 0.7007, - 0.7096, - 0.7026, - 0.691, - 0.6837, - 0.6686, - 0.6765, - 0.6695, - 0.6704, - 0.6776, - 0.6684, - 0.6589, - 0.6523, - 0.6463, - 0.6457, - 0.6599, - 0.6584, - 0.6509, - 0.649, - 0.6432, - 0.6291, - 0.6317, - 0.6497, - 0.6386, - 0.6364, - 0.6335, - 0.63, - 0.6196, - 0.6176, - 0.6166, - 0.6159, - 0.6182, - 0.6115, - 0.6156, - 0.6159, - 0.614, - 0.6075, - 0.6008, - 0.6058, - 0.6076, - 0.6055, - 0.6006, - 0.599, - 0.5892, - 0.5952, - 0.5943 - ], - "per_window_sharpe": [ - -2.714, - -0.921, - -0.39, - -1.089, - -1.966 - ] -} \ No newline at end of file diff --git a/results/results_iter_2.json b/results/results_iter_2.json deleted file mode 100644 index 715b52b..0000000 --- a/results/results_iter_2.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "sharpe_ratio": -0.546, - "total_return_pct": -18.32, - "max_drawdown_pct": -20.98, - "win_rate": 0.34, - "trade_count": 53, - "profit_factor": 0.542, - "avg_trade_duration_candles": 2.3, - "feature_importances": { - "EMA_20": 0.0295, - "EMA_5": 0.0274, - "OBV": 0.0252, - "price_vs_SMA_50": 0.0219, - "EMA_10": 0.0214, - "SMA_200": 0.0207, - "return_lag_5": 0.0191, - "SMA_5": 0.0189, - "vwap_approx": 0.0187, - "price_vs_SMA_200": 0.0186, - "BB_lower": 0.0181, - "SMA_20": 0.0175, - "ATR_pct": 0.0174, - "keltner_upper": 0.0172, - "volume_sma_20": 0.017, - "ATR_14": 0.0169, - "return_5": 0.0167, - "BB_upper": 0.0166, - "SMA_50": 0.0164, - "RSI_21": 0.0163, - "high_low_range_10": 0.0163, - "hist_volatility": 0.0163, - "high_low_range_20": 0.0163, - "EMA_50": 0.0162, - "keltner_lower": 0.016, - "MACD_hist": 0.0159, - "RSI_14_lag_1": 0.0152, - "CCI_20": 0.015, - "high_low_range_5": 0.015, - "volatility_20": 0.0149 - }, - "monthly_returns": [ - -2.62, - -1.95, - -4.71, - 1.32, - -2.8, - 1.53, - -1.85, - -4.51, - -2.54, - -3.73, - 0.01, - -1.05, - 2.97, - 0.31 - ], - "equity_curve": [ - 1.0, - 0.9952, - 0.9921, - 0.9767, - 0.974, - 0.9579, - 0.9754, - 0.954, - 0.9546, - 0.9336, - 0.9323, - 0.9308, - 0.9103, - 0.9023, - 0.8926, - 0.9265, - 0.9217, - 0.9567, - 0.9357, - 0.9151, - 0.8949, - 0.8857, - 0.8992, - 0.9025, - 0.9085, - 0.9106, - 0.9157, - 0.8956, - 0.8916, - 0.8842, - 0.8766, - 0.8663, - 0.852, - 0.8467, - 0.828, - 0.8386, - 0.8304, - 0.8167, - 0.808, - 0.7902, - 0.7995, - 0.7912, - 0.7984, - 0.8069, - 0.7995, - 0.8115, - 0.8109, - 0.8086, - 0.7908, - 0.7941, - 0.8167, - 0.8076, - 0.8143, - 0.8168 - ], - "per_window_sharpe": [ - -2.302, - -0.762, - -6.981, - -0.909, - 4.91 - ] -} \ No newline at end of file