feat: confidence filter ≥ 1.5, убрать DOT, exp21-22 эксперименты

- Confidence filter |corr| × amplitude/ATR ≥ 1.5 (exp22: Sharpe 0.92→1.43, DD 20%→10.8%)
- Убран DOT (убыточен), 6→5 активов, веса перераспределены
- OHLCV в dataset (exp21), 4 фазы exp22 (стопы, фильтрация, таймфрейм, комбинации)
- OHLCV helper в signals.py, dataset.py поддерживает OHLCV

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-11 01:05:42 +10:00
co-authored by Claude Opus 4.6
parent aaa9dd6ecb
commit a474b3eb32
24 changed files with 8595 additions and 28 deletions
+10 -4
View File
@@ -24,7 +24,7 @@ def save_dataset(name: str = "default") -> Path:
"""Fetch all assets from exchange and save as fixed dataset."""
import sys
sys.path.insert(0, str(Path(__file__).parent.parent.parent / "src"))
from remizov_trader.core.signals import fetch_prices_ccxt
from remizov_trader.core.signals import fetch_ohlcv_ccxt
DATA_DIR.mkdir(parents=True, exist_ok=True)
dataset_dir = DATA_DIR / name
@@ -36,13 +36,15 @@ def save_dataset(name: str = "default") -> Path:
ticker, symbol, tf = a["ticker"], a["symbol"], a["tf"]
print(f" Fetching {ticker} ({tf})...", end=" ", flush=True)
prices, dates = fetch_prices_ccxt(symbol, tf, "max")
if prices is None or len(prices) < 100:
ohlcv, dates = fetch_ohlcv_ccxt(symbol, tf, "max")
if ohlcv is None or len(ohlcv) < 100:
print("SKIP (not enough data)")
continue
# Save prices as .npy, dates as strings in .json
prices = ohlcv[:, 3] # close column
# Save prices (backward compat) + full OHLCV
np.save(dataset_dir / f"{ticker}_prices.npy", prices)
np.save(dataset_dir / f"{ticker}_ohlcv.npy", ohlcv)
dates_str = [str(d) for d in dates]
(dataset_dir / f"{ticker}_dates.json").write_text(json.dumps(dates_str))
@@ -82,8 +84,12 @@ def load_dataset(name: str = "default") -> dict:
# Convert to numpy array of date strings for compatibility
dates = np.array(dates_str)
ohlcv_path = dataset_dir / f"{ticker}_ohlcv.npy"
ohlcv = np.load(ohlcv_path) if ohlcv_path.exists() else None
result[ticker] = {
"prices": prices,
"ohlcv": ohlcv, # (N,4) [O,H,L,C] or None for old datasets
"dates": dates,
"tf": info["tf"],
"ws": info["ws"],