Data provider: key from config.json/env, provider registry, drop hardcoded key

Resolves the Twelve Data API key through app_config.provider_api_key()
(env → config.json → no default) instead of a hardcoded field on
PlatformConfig. Adds data_provider.PROVIDER_REGISTRY + make_data_provider()
so signal_aggregator and the backtester build the active provider through
one seam; telegram_bot.py gets the same one-line WS-key fix now (per Task 4's
already-planned edit for that line) so the suite doesn't crash on import
between this commit and Task 4's full wiring pass.

Claude-Session: https://claude.ai/code/session_01VPNF37MP9Kuv62B1VBrZ1b
This commit is contained in:
Harwinder Sekhon
2026-07-21 13:10:58 -04:00
parent 1610507d57
commit 80a2b89769
6 changed files with 68 additions and 14 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ from config import ( # noqa: E402
Timeframe,
XAUUSD,
)
from data_provider import ForexDataProvider # noqa: E402
from data_provider import ForexDataProvider, make_data_provider # noqa: E402
from engine import IndicatorSignal, TechnicalAnalysis, TechnicalEngine # noqa: E402
from signal_aggregator import SignalAggregator, SignalReport, TradeSetup # noqa: E402
@@ -1679,7 +1679,7 @@ def run_backtest(
f"vs PlatformConfig={platform_cfg.primary_timeframe.value}"
)
provider = ForexDataProvider(platform_cfg)
provider = make_data_provider(platform_cfg)
# ── Load all required timeframes ──
timeframes = [bt_cfg.primary_tf] + list(bt_cfg.confirmation_tfs)