From efce7192820268652a9b2de69e2df8db39e50c0f Mon Sep 17 00:00:00 2001 From: anor Date: Tue, 10 Mar 2026 21:13:17 +1000 Subject: [PATCH] =?UTF-8?q?refactor:=20=D1=83=D0=B1=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20XRP=20=D0=B8=D0=B7=20=D0=BF=D0=BE=D1=80=D1=82=D1=84?= =?UTF-8?q?=D0=B5=D0=BB=D1=8F,=206=20=D0=B0=D0=BA=D1=82=D0=B8=D0=B2=D0=BE?= =?UTF-8?q?=D0=B2=20=D1=81=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D1=91?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D0=BC=D0=B8=20=D0=B2=D0=B5=D1=81=D0=B0=D0=BC?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Бэктест exp19: без XRP +$251 (+98.8%), Sharpe 1.69 vs +$200 (+78.6%) с XRP. Вес XRP (9.2%) → ADA (+4.6%) и DOT (+4.6%). BTC и ADA: K=3 (exp18 оптимум). total обновлён до $254. Co-Authored-By: Claude Opus 4.6 --- config.yaml | 48 ++++++++++++--------------- experiments/common/dataset.py | 5 ++- experiments/exp19_bybit_margin/run.py | 11 +++--- src/remizov_trader/core/executor.py | 2 +- src/remizov_trader/notify.py | 4 +-- 5 files changed, 32 insertions(+), 38 deletions(-) diff --git a/config.yaml b/config.yaml index c7abd2b..3ae5b58 100644 --- a/config.yaml +++ b/config.yaml @@ -4,19 +4,26 @@ mode: live # paper | live capital: initial: 16.0 # per-asset (new assets) - total: 114.0 # actual total capital deposited + total: 254.0 # actual total capital deposited currency: USDC risk: per_trade: 0.05 # 5% risk per trade max_position_pct: 0.40 # max 40% of equity (min $5 Bybit limit) - max_open_positions: 7 # 7 assets, one position per asset + max_open_positions: 6 # 6 assets (XRP removed), one position per asset leverage: 2 # 2x spot margin (exp12: DD ~14%, Sharpe stable) stop_scale: 0.5 # exp16e: tighter stop = faster exit + cooldown (Sharpe 4.15) time_exit: false # exp16e: no forced close, hold until stop (Sharpe +70%) safety_stop_pct: 0.10 # 10% hard stop on exchange (flash crash protection) assets: + - ticker: BTC-USD + symbol: BTC/USDC + window_size: 32 + weight: 0.241 + leverage: 2 + K: 3 + - ticker: ETH-USD symbol: ETH/USDC timeframe: 2h @@ -24,17 +31,17 @@ assets: weight: 0.158 leverage: 2 - - ticker: SOL-USD - symbol: SOL/USDC - timeframe: 2h - window_size: 128 - weight: 0.108 + - ticker: ADA-USD + symbol: ADA/USDC + window_size: 64 + weight: 0.183 leverage: 2 + K: 3 - - ticker: BTC-USD - symbol: BTC/USDC + - ticker: DOT-USD + symbol: DOT/USDC window_size: 32 - weight: 0.241 + weight: 0.183 leverage: 2 - ticker: DOGE-USD @@ -43,22 +50,11 @@ assets: weight: 0.127 leverage: 2 - - ticker: ADA-USD - symbol: ADA/USDC - window_size: 64 - weight: 0.137 - leverage: 2 - - - ticker: XRP-USD - symbol: XRP/USDC - window_size: 64 - weight: 0.092 - leverage: 2 - - - ticker: DOT-USD - symbol: DOT/USDC - window_size: 32 - weight: 0.137 + - ticker: SOL-USD + symbol: SOL/USDC + timeframe: 2h + window_size: 128 + weight: 0.108 leverage: 2 model: diff --git a/experiments/common/dataset.py b/experiments/common/dataset.py index 4b1d00f..9d3372a 100644 --- a/experiments/common/dataset.py +++ b/experiments/common/dataset.py @@ -13,11 +13,10 @@ DATA_DIR = Path(__file__).parent.parent / "data" ASSETS = [ {"symbol": "BTC/USDC", "ticker": "BTC-USD", "tf": "4h", "ws": 32, "leverage": 2, "weight": 0.241}, {"symbol": "ETH/USDC", "ticker": "ETH-USD", "tf": "2h", "ws": 64, "leverage": 2, "weight": 0.158}, - {"symbol": "ADA/USDC", "ticker": "ADA-USD", "tf": "4h", "ws": 64, "leverage": 2, "weight": 0.137}, - {"symbol": "DOT/USDC", "ticker": "DOT-USD", "tf": "4h", "ws": 32, "leverage": 2, "weight": 0.137}, + {"symbol": "ADA/USDC", "ticker": "ADA-USD", "tf": "4h", "ws": 64, "leverage": 2, "weight": 0.183}, + {"symbol": "DOT/USDC", "ticker": "DOT-USD", "tf": "4h", "ws": 32, "leverage": 2, "weight": 0.183}, {"symbol": "DOGE/USDC", "ticker": "DOGE-USD", "tf": "4h", "ws": 48, "leverage": 2, "weight": 0.127}, {"symbol": "SOL/USDC", "ticker": "SOL-USD", "tf": "2h", "ws": 128, "leverage": 2, "weight": 0.108}, - {"symbol": "XRP/USDC", "ticker": "XRP-USD", "tf": "4h", "ws": 64, "leverage": 2, "weight": 0.092}, ] diff --git a/experiments/exp19_bybit_margin/run.py b/experiments/exp19_bybit_margin/run.py index 095cbf5..5c21ae0 100644 --- a/experiments/exp19_bybit_margin/run.py +++ b/experiments/exp19_bybit_margin/run.py @@ -29,7 +29,7 @@ from remizov_trader.config import ModelConfig from common.metrics import compute_metrics, save_results from common.dataset import load_or_fetch, load_cached_model, save_cached_model -TOTAL_CAPITAL = 114.0 +TOTAL_CAPITAL = 254.0 K = 2 CORR_THRESH = 0.5 TRAILING_STOP = True @@ -71,18 +71,17 @@ SPOT_MM_RATE = {k: v * 0.5 for k, v in SPOT_IM_RATE.items()} # Correlation groups — same as production CORRELATED_GROUPS = [ {"BTC-USD", "ETH-USD"}, - {"ADA-USD", "DOT-USD", "XRP-USD"}, + {"ADA-USD", "DOT-USD"}, ] -# Sharpe-optimal config from exp15, with per-asset K from exp18 +# Config: XRP removed, its 9.2% weight split to ADA (+4.6%) and DOT (+4.6%) ASSETS = [ {"symbol": "BTC/USDC", "ticker": "BTC-USD", "tf": "4h", "ws": 32, "leverage": 2, "weight": 0.241, "K": 3}, {"symbol": "ETH/USDC", "ticker": "ETH-USD", "tf": "2h", "ws": 64, "leverage": 2, "weight": 0.158, "K": 2}, - {"symbol": "ADA/USDC", "ticker": "ADA-USD", "tf": "4h", "ws": 64, "leverage": 2, "weight": 0.137, "K": 3}, - {"symbol": "DOT/USDC", "ticker": "DOT-USD", "tf": "4h", "ws": 32, "leverage": 2, "weight": 0.137, "K": 2}, + {"symbol": "ADA/USDC", "ticker": "ADA-USD", "tf": "4h", "ws": 64, "leverage": 2, "weight": 0.183, "K": 3}, + {"symbol": "DOT/USDC", "ticker": "DOT-USD", "tf": "4h", "ws": 32, "leverage": 2, "weight": 0.183, "K": 2}, {"symbol": "DOGE/USDC", "ticker": "DOGE-USD", "tf": "4h", "ws": 48, "leverage": 2, "weight": 0.127, "K": 2}, {"symbol": "SOL/USDC", "ticker": "SOL-USD", "tf": "2h", "ws": 128, "leverage": 2, "weight": 0.108, "K": 2}, - {"symbol": "XRP/USDC", "ticker": "XRP-USD", "tf": "4h", "ws": 64, "leverage": 2, "weight": 0.092, "K": 2}, ] diff --git a/src/remizov_trader/core/executor.py b/src/remizov_trader/core/executor.py index 0451be4..7d87618 100644 --- a/src/remizov_trader/core/executor.py +++ b/src/remizov_trader/core/executor.py @@ -195,7 +195,7 @@ def _count_open_positions(conn: sqlite3.Connection) -> int: # Correlated asset groups — don't take same direction in both CORRELATED_GROUPS = [ {"BTC-USD", "ETH-USD"}, # major cryptos move together - {"ADA-USD", "DOT-USD", "XRP-USD"}, # L1/alt layer group + {"ADA-USD", "DOT-USD"}, # L1/alt layer group ] diff --git a/src/remizov_trader/notify.py b/src/remizov_trader/notify.py index 795c184..f48f1a1 100644 --- a/src/remizov_trader/notify.py +++ b/src/remizov_trader/notify.py @@ -518,8 +518,8 @@ _AI_ANALYTICS_PROMPT = """Ты — старший квант-аналитик. - Вход: shape confirmation (correlation предсказания vs реальность > 0.5) - correlation=1.0 → точное совпадение, -1.0 → модель видит инверсию (возможный баг модели) - Бэктест: WR 42%, Sharpe 4.15 при stop_scale=0.5, time_exit=OFF -- 2x leverage, Bybit spot margin, 7 крипто, portfolio weights -- CB: ATR14/ATR50>3 или DD>20%. Correlation filter: BTC+ETH, ADA+DOT+XRP — не дублируются +- 2x leverage, Bybit spot margin, 6 крипто (BTC ETH ADA DOT DOGE SOL), portfolio weights +- CB: ATR14/ATR50>3 или DD>20%. Correlation filter: BTC+ETH, ADA+DOT — не дублируются - Spot: SHORT блокируется. Cooldown: shift баров после стопа ПРАВИЛА (ОБЯЗАТЕЛЬНО):