Fix concurrent API credit exhaustion — shared prefetch + dedup warnings

- telegram_bot: one ForexDataProvider shared across all SCAN_TIMEFRAMES;
  combined prefetch of all unique TFs up front so the 4 concurrent scans
  hit the warm cache instead of firing simultaneous API calls
- data_provider: skip prefetch_batch for timeframes already in cache
- data_provider: deduplicate "no data" warning per symbol (fires once, not once per TF)
- data_provider: [live] info log on successful fetch; outlier-removal downgraded to debug

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Harwinder
2026-05-04 20:48:25 -04:00
parent 8ca59c6a21
commit df77e0fb5e
3 changed files with 30 additions and 10 deletions
+2 -2
View File
@@ -104,9 +104,9 @@ class SignalAggregator:
fundamental analysis, and produces final graded signals.
"""
def __init__(self, config: PlatformConfig):
def __init__(self, config: PlatformConfig, data_provider: Optional[ForexDataProvider] = None):
self.config = config
self.data_provider = ForexDataProvider(config)
self.data_provider = data_provider or ForexDataProvider(config)
self.tech_engine = TechnicalEngine(config.technical)
self.news_engine = NewsEngine(config.news)