main: build_config uses the pair factory's confirmation map (fixes an M5 divergence)
main.py kept a private confirmation table and passed it into the pair factory, which honours any non-None list. For M5 that table said [M1, M15] while the factory, telegram_bot.TF_CONFIRMATIONS and dashboard_publisher.CONFIRMATIONS all use the validated [M15, H1] - so `main.py --timeframe M5` scanned with an unvalidated pairing (and an extra M1 fetch) that no other surface used. - build_config now returns PAIR_PRODUCERS[pair](tf, None): the factory map is the single source of truth. The unreachable bare-PlatformConfig fallback is gone here and in telegram_bot._run_signal_sync (every symbol that reaches either is registered). - --timeframe offers the four validated primaries (M5, M15, H1, H4). M30 and D1 were never validated and silently fell through to the generic [M15, H4] map; they are removed from the CLI. - The "all valid timeframes" test now asserts each CLI timeframe's confirmation list equals pair_signals.xauusd._CONFIRMATIONS - the check that would have caught this. CLI behaviour change: M5 confirmations [M1, M15] -> [M15, H1]; M30/D1 rejected. Bot and dashboard scans are unchanged. Suite: 461 passed, 0 failed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0156YhogLytzj9P2iH1skGbL
This commit is contained in:
+3
-9
@@ -497,15 +497,9 @@ def _run_signal_sync(
|
||||
timeframe, [Timeframe.M15, Timeframe.H4]
|
||||
)
|
||||
# Per-pair tuned configs (regime weights, gates, sessions) come from
|
||||
# the pair_signals factories; a plain PlatformConfig would silently
|
||||
# run every pair with XAU defaults.
|
||||
factory = PAIR_PRODUCERS.get(symbol)
|
||||
if factory is not None:
|
||||
config = factory(timeframe, confirmation_tfs)
|
||||
else:
|
||||
config = PlatformConfig()
|
||||
config.primary_timeframe = timeframe
|
||||
config.confirmation_timeframes = confirmation_tfs
|
||||
# the pair_signals factories; every scanned symbol is registered there
|
||||
# (SCAN_PAIRS is validated against PAIR_INFO at import).
|
||||
config = PAIR_PRODUCERS[symbol](timeframe, confirmation_tfs)
|
||||
aggregator = SignalAggregator(config)
|
||||
aggregator.data_provider = _get_shared_dp()
|
||||
return aggregator.analyze_pair(symbol=symbol, log_source="telegram")
|
||||
|
||||
Reference in New Issue
Block a user