From a326777c423c516448eb92c10b1198d161ff69d4 Mon Sep 17 00:00:00 2001 From: Harwinder Sekhon Date: Sun, 6 Sep 2026 16:57:40 -0400 Subject: [PATCH] config: remove the never-read PlatformConfig.pip_value (rule 8) Every live reader of a pip value goes through PAIR_INFO[...]["pip_value"] (signal_aggregator, gpu_backtest, diagnose_filters) or TradeSetup.pip_value; no code read the PlatformConfig field. The three PlatformConfig(...) constructions that passed it (gpu_backtest x2, diagnose_filters) and the inline construction in the factory-equivalence test drop the kwarg. Neither config fingerprint hashes the field, so logged fingerprints are unchanged. The removed-field test now also asserts pip_value stays gone. Parity: 12-month M5 and H1 books regenerated byte-identical (md5 a28fed4becd056466c26d6a947e1a0e5 / d20405ef64f069770c258bb9bed1ac90). Suite: 461 passed, 0 failed. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_0156YhogLytzj9P2iH1skGbL --- backtest/diagnose_filters.py | 1 - backtest/gpu_backtest.py | 2 -- config.py | 1 - test_all.py | 5 +++-- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/backtest/diagnose_filters.py b/backtest/diagnose_filters.py index 76593cf..a8815c2 100644 --- a/backtest/diagnose_filters.py +++ b/backtest/diagnose_filters.py @@ -220,7 +220,6 @@ def run_diagnosis( platform_cfg = PlatformConfig( symbol=pair, display_name=display, - pip_value=pair_info["pip_value"], primary_timeframe=primary_tf, confirmation_timeframes=list(confirm_tfs), ) diff --git a/backtest/gpu_backtest.py b/backtest/gpu_backtest.py index a238aaf..1aac28d 100644 --- a/backtest/gpu_backtest.py +++ b/backtest/gpu_backtest.py @@ -1763,7 +1763,6 @@ def run_backtest( platform_cfg = PlatformConfig( symbol=bt_cfg.pair, display_name=PAIR_INFO[bt_cfg.pair]["display"], - pip_value=PAIR_INFO[bt_cfg.pair]["pip_value"], primary_timeframe=bt_cfg.primary_tf, confirmation_timeframes=list(bt_cfg.confirmation_tfs), ) @@ -2402,7 +2401,6 @@ def main(argv: Optional[List[str]] = None) -> int: platform_cfg = PlatformConfig( symbol=pair, display_name=PAIR_INFO[pair]["display"], - pip_value=PAIR_INFO[pair]["pip_value"], primary_timeframe=primary_tf, confirmation_timeframes=confirm_tfs or [Timeframe.H1, Timeframe.H4], ) diff --git a/config.py b/config.py index 635aa8f..0c7bf65 100755 --- a/config.py +++ b/config.py @@ -332,7 +332,6 @@ class PlatformConfig: symbol: str = XAUUSD display_name: str = "XAU/USD" - pip_value: float = 0.10 primary_timeframe: Timeframe = Timeframe.H1 confirmation_timeframes: List[Timeframe] = field( diff --git a/test_all.py b/test_all.py index 713c03f..048a381 100644 --- a/test_all.py +++ b/test_all.py @@ -2072,7 +2072,6 @@ def _(): inline_cfg = PlatformConfig( symbol=XAUUSD, display_name="XAU/USD", - pip_value=0.10, primary_timeframe=tf, confirmation_timeframes=ctfs, ) @@ -3259,10 +3258,12 @@ def _(): assert deepseek_api_key(AppConfig()) == "" -@test("config.py: hardcoded twelve_data_api_key field is gone") +@test("config.py: removed PlatformConfig fields stay gone (twelve_data_api_key, pip_value)") def _(): assert not hasattr(PlatformConfig(), "twelve_data_api_key"), \ "credentials must not live in committed source" + # pip value comes from PAIR_INFO; the config field was never read (2026-09-06). + assert not hasattr(PlatformConfig(), "pip_value") @test("telegram_bot: credentials, quality, pairs, loops from app_config")