Remove dead code: legacy config fields, unused helpers/imports, stray files

- Delete test_ws_dual.py (standalone probe, unused) and a stale tracked log
- config.py: drop MarketSession enum, is_jpy_pair, candle_buffer_seconds,
  and the never-read legacy SignalConfig/XauStrategyConfig fields
- data_provider.py: drop uncalled get_latest_price/get_spread_estimate
- Remove unused imports (engine, telegram_bot, main, news_engine)
- test_all.py: drop/trim the corresponding defaults assertions (199 tests)
- CLAUDE.md updated to match

Zero behavior change: no production code read any removed field
(verified reference-by-reference); suite green at 199/199.

Claude-Session: https://claude.ai/code/session_01VPNF37MP9Kuv62B1VBrZ1b
This commit is contained in:
Harwinder Sekhon
2026-07-21 14:06:55 -04:00
parent c8a2c83820
commit f0f9dcb169
10 changed files with 9 additions and 222 deletions
+2 -21
View File
@@ -100,7 +100,7 @@ def make_xau_ohlcv(n=300, start_price=2400.0, seed=42):
print("\n═══ Module 1: config.py ═══")
from config import (
Timeframe, SignalStrength, MarketSession,
Timeframe, SignalStrength,
PlatformConfig, TechnicalConfig, SignalConfig, NewsConfig,
FilterConfig, XauStrategyConfig,
XAUUSD, PAIR_INFO,
@@ -130,24 +130,13 @@ def _():
assert SignalStrength.SELL.value > SignalStrength.STRONG_SELL.value
@test("MarketSession enum values")
def _():
assert MarketSession.SYDNEY.value == "sydney"
assert MarketSession.TOKYO.value == "tokyo"
assert MarketSession.LONDON.value == "london"
assert MarketSession.NEW_YORK.value == "new_york"
assert MarketSession.OVERLAP_LONDON_NY.value == "london_ny_overlap"
@test("PAIR_INFO completeness and correctness")
def _():
assert XAUUSD in PAIR_INFO
for pair, info in PAIR_INFO.items():
assert "display" in info, f"Missing 'display' for {pair}"
assert "pip_value" in info, f"Missing 'pip_value' for {pair}"
assert "is_jpy_pair" in info, f"Missing 'is_jpy_pair' for {pair}"
assert info["pip_value"] > 0, f"pip_value must be > 0 for {pair}"
assert PAIR_INFO[XAUUSD]["is_jpy_pair"] is False
assert PAIR_INFO[XAUUSD]["pip_value"] == 0.10
@@ -180,14 +169,9 @@ def _():
@test("SignalConfig defaults")
def _():
sc = SignalConfig()
assert sc.min_confidence == 55.0
assert sc.mtf_agreement_threshold == 2
assert sc.min_rr_ratio == 0.5
assert sc.tp_tightening_factor == 1.0
assert sc.atr_sl_multiplier == 1.5
assert sc.default_rr_ratio == 2.0
assert sc.cooldown_bars == 5
assert "ema_trend" in sc.weights
assert "rsi" in sc.weights
@test("PlatformConfig defaults")
@@ -206,9 +190,6 @@ def _():
def _():
xc = XauStrategyConfig()
assert xc.enabled is True
assert xc.rsi_entry_threshold == 45.0
assert xc.min_ema200_tfs == 2
assert xc.allow_generic_trades is True
assert xc.tp_atr_multiplier == 1.0
assert xc.sl_atr_multiplier == 2.0
assert isinstance(xc.blocked_hours_utc, list)