Replace XAU/USD with USD/CAD — TwelveData has no gold data
XAU/USD is not available in TwelveData's symbol list. Swapped to USD/CAD across config, scan pairs, Telegram buttons, and added CAD to tracked news currencies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,13 +39,13 @@ class MarketSession(Enum):
|
|||||||
USDJPY = "USDJPY=X"
|
USDJPY = "USDJPY=X"
|
||||||
EURUSD = "EURUSD=X"
|
EURUSD = "EURUSD=X"
|
||||||
GBPUSD = "GBPUSD=X"
|
GBPUSD = "GBPUSD=X"
|
||||||
XAUUSD = "XAUUSD=X"
|
USDCAD = "USDCAD=X"
|
||||||
|
|
||||||
PAIR_INFO = {
|
PAIR_INFO = {
|
||||||
USDJPY: {"display": "USD/JPY", "pip_value": 0.01, "is_jpy_pair": True},
|
USDJPY: {"display": "USD/JPY", "pip_value": 0.01, "is_jpy_pair": True},
|
||||||
EURUSD: {"display": "EUR/USD", "pip_value": 0.0001, "is_jpy_pair": False},
|
EURUSD: {"display": "EUR/USD", "pip_value": 0.0001, "is_jpy_pair": False},
|
||||||
GBPUSD: {"display": "GBP/USD", "pip_value": 0.0001, "is_jpy_pair": False},
|
GBPUSD: {"display": "GBP/USD", "pip_value": 0.0001, "is_jpy_pair": False},
|
||||||
XAUUSD: {"display": "XAU/USD", "pip_value": 0.10, "is_jpy_pair": False},
|
USDCAD: {"display": "USD/CAD", "pip_value": 0.0001, "is_jpy_pair": False},
|
||||||
}
|
}
|
||||||
|
|
||||||
# Defaults (kept for backward compat)
|
# Defaults (kept for backward compat)
|
||||||
@@ -121,7 +121,7 @@ class SignalConfig:
|
|||||||
@dataclass
|
@dataclass
|
||||||
class NewsConfig:
|
class NewsConfig:
|
||||||
"""Economic calendar & sentiment."""
|
"""Economic calendar & sentiment."""
|
||||||
tracked_currencies: List[str] = field(default_factory=lambda: ["USD", "JPY", "EUR", "GBP"])
|
tracked_currencies: List[str] = field(default_factory=lambda: ["USD", "JPY", "EUR", "GBP", "CAD"])
|
||||||
min_impact: str = "medium"
|
min_impact: str = "medium"
|
||||||
pre_event_buffer_minutes: int = 30
|
pre_event_buffer_minutes: int = 30
|
||||||
post_event_buffer_minutes: int = 15
|
post_event_buffer_minutes: int = 15
|
||||||
@@ -168,7 +168,7 @@ class PlatformConfig:
|
|||||||
refresh_interval: int = 300
|
refresh_interval: int = 300
|
||||||
|
|
||||||
scan_pairs: List[str] = field(
|
scan_pairs: List[str] = field(
|
||||||
default_factory=lambda: [EURUSD, USDJPY, GBPUSD, XAUUSD]
|
default_factory=lambda: [EURUSD, USDJPY, GBPUSD, USDCAD]
|
||||||
)
|
)
|
||||||
scan_timeframes: List[Timeframe] = field(
|
scan_timeframes: List[Timeframe] = field(
|
||||||
default_factory=lambda: [Timeframe.M15, Timeframe.H1]
|
default_factory=lambda: [Timeframe.M15, Timeframe.H1]
|
||||||
|
|||||||
+4
-4
@@ -40,7 +40,7 @@ from telegram.ext import (
|
|||||||
|
|
||||||
from config import (
|
from config import (
|
||||||
PlatformConfig, SignalStrength, Timeframe,
|
PlatformConfig, SignalStrength, Timeframe,
|
||||||
EURUSD, USDJPY, GBPUSD, XAUUSD, PAIR_INFO,
|
EURUSD, USDJPY, GBPUSD, USDCAD, PAIR_INFO,
|
||||||
)
|
)
|
||||||
from data_provider import ForexDataProvider
|
from data_provider import ForexDataProvider
|
||||||
from signal_aggregator import SignalAggregator, SignalReport
|
from signal_aggregator import SignalAggregator, SignalReport
|
||||||
@@ -63,7 +63,7 @@ CHAT_ID = os.environ.get("TELEGRAM_CHAT_ID", "6025899022")
|
|||||||
|
|
||||||
# ── Pairs & buttons ───────────────────────────────────────────────────
|
# ── Pairs & buttons ───────────────────────────────────────────────────
|
||||||
|
|
||||||
SCAN_PAIRS = [EURUSD, USDJPY, GBPUSD, XAUUSD]
|
SCAN_PAIRS = [EURUSD, USDJPY, GBPUSD, USDCAD]
|
||||||
|
|
||||||
SCAN_BUTTONS = [
|
SCAN_BUTTONS = [
|
||||||
{"cb": "scan_eurusd_m15", "symbol": EURUSD, "tf": Timeframe.M15, "label": "EUR/USD 15M"},
|
{"cb": "scan_eurusd_m15", "symbol": EURUSD, "tf": Timeframe.M15, "label": "EUR/USD 15M"},
|
||||||
@@ -72,8 +72,8 @@ SCAN_BUTTONS = [
|
|||||||
{"cb": "scan_usdjpy_h1", "symbol": USDJPY, "tf": Timeframe.H1, "label": "USD/JPY 1H"},
|
{"cb": "scan_usdjpy_h1", "symbol": USDJPY, "tf": Timeframe.H1, "label": "USD/JPY 1H"},
|
||||||
{"cb": "scan_gbpusd_m15", "symbol": GBPUSD, "tf": Timeframe.M15, "label": "GBP/USD 15M"},
|
{"cb": "scan_gbpusd_m15", "symbol": GBPUSD, "tf": Timeframe.M15, "label": "GBP/USD 15M"},
|
||||||
{"cb": "scan_gbpusd_h1", "symbol": GBPUSD, "tf": Timeframe.H1, "label": "GBP/USD 1H"},
|
{"cb": "scan_gbpusd_h1", "symbol": GBPUSD, "tf": Timeframe.H1, "label": "GBP/USD 1H"},
|
||||||
{"cb": "scan_xauusd_m15", "symbol": XAUUSD, "tf": Timeframe.M15, "label": "XAU/USD 15M"},
|
{"cb": "scan_usdcad_m15", "symbol": USDCAD, "tf": Timeframe.M15, "label": "USD/CAD 15M"},
|
||||||
{"cb": "scan_xauusd_h1", "symbol": XAUUSD, "tf": Timeframe.H1, "label": "XAU/USD 1H"},
|
{"cb": "scan_usdcad_h1", "symbol": USDCAD, "tf": Timeframe.H1, "label": "USD/CAD 1H"},
|
||||||
]
|
]
|
||||||
|
|
||||||
SCAN_LOOKUP = {b["cb"]: b for b in SCAN_BUTTONS}
|
SCAN_LOOKUP = {b["cb"]: b for b in SCAN_BUTTONS}
|
||||||
|
|||||||
Reference in New Issue
Block a user