Remove XAU/USD from Telegram bot, EUR/USD only

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
harwinder
2026-05-21 19:23:50 -04:00
parent 25791fefa3
commit 0593e455bc
+8 -13
View File
@@ -4,7 +4,7 @@ ForexBot2 — Telegram Bot
======================== ========================
Async Telegram interface with candle-boundary auto-scanner. Async Telegram interface with candle-boundary auto-scanner.
Manual scan: XAU/USD + EUR/USD via inline buttons. Manual scan: EUR/USD via inline buttons.
Auto-scan: Starts automatically on boot if TELEGRAM_CHAT_ID is set. Auto-scan: Starts automatically on boot if TELEGRAM_CHAT_ID is set.
/autoscan toggles for additional chats or to stop. /autoscan toggles for additional chats or to stop.
M5 fires at :00/:05/:10/… + 10s buffer (data only, no signals). M5 fires at :00/:05/:10/… + 10s buffer (data only, no signals).
@@ -40,7 +40,7 @@ from telegram.ext import (
from config import ( from config import (
PlatformConfig, SignalStrength, Timeframe, PlatformConfig, SignalStrength, Timeframe,
XAUUSD, EURUSD, PAIR_INFO, EURUSD, PAIR_INFO,
) )
from data_provider import ForexDataProvider from data_provider import ForexDataProvider
from signal_aggregator import SignalAggregator, SignalReport from signal_aggregator import SignalAggregator, SignalReport
@@ -72,7 +72,7 @@ CHAT_ID = os.environ.get("TELEGRAM_CHAT_ID", "6025899022")
# ── Pairs & buttons ─────────────────────────────────────────────────── # ── Pairs & buttons ───────────────────────────────────────────────────
SCAN_PAIRS = [XAUUSD, EURUSD] SCAN_PAIRS = [EURUSD]
_LEVEL_KEYS = ( _LEVEL_KEYS = (
"swing_high_1", "swing_high_2", "swing_high_3", "swing_high_1", "swing_high_2", "swing_high_3",
@@ -89,11 +89,6 @@ _stats_updated: Optional[float] = None
_last_sent: Dict[str, Dict] = {} _last_sent: Dict[str, Dict] = {}
SCAN_BUTTONS = [ SCAN_BUTTONS = [
{"cb": "scan_xauusd_m5", "symbol": XAUUSD, "tf": Timeframe.M5, "label": "XAU 5m"},
{"cb": "scan_xauusd_m15", "symbol": XAUUSD, "tf": Timeframe.M15, "label": "XAU 15m"},
{"cb": "scan_xauusd_h1", "symbol": XAUUSD, "tf": Timeframe.H1, "label": "XAU 1h"},
{"cb": "scan_xauusd_h4", "symbol": XAUUSD, "tf": Timeframe.H4, "label": "XAU 4h"},
{"cb": "scan_xauusd_all", "symbol": XAUUSD, "tf": None, "label": "XAU All"},
{"cb": "scan_eurusd_m5", "symbol": EURUSD, "tf": Timeframe.M5, "label": "EUR 5m"}, {"cb": "scan_eurusd_m5", "symbol": EURUSD, "tf": Timeframe.M5, "label": "EUR 5m"},
{"cb": "scan_eurusd_m15", "symbol": EURUSD, "tf": Timeframe.M15, "label": "EUR 15m"}, {"cb": "scan_eurusd_m15", "symbol": EURUSD, "tf": Timeframe.M15, "label": "EUR 15m"},
{"cb": "scan_eurusd_h1", "symbol": EURUSD, "tf": Timeframe.H1, "label": "EUR 1h"}, {"cb": "scan_eurusd_h1", "symbol": EURUSD, "tf": Timeframe.H1, "label": "EUR 1h"},
@@ -660,7 +655,7 @@ async def cmd_help(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
text = ( text = (
"📖 *ForexBot2 Commands*\n\n" "📖 *ForexBot2 Commands*\n\n"
"/start — Welcome & scan buttons\n" "/start — Welcome & scan buttons\n"
"/scan — Quick scan buttons (XAU/USD + EUR/USD)\n" "/scan — Quick scan buttons (EUR/USD)\n"
"/autoscan — Toggle auto-scan on/off\n" "/autoscan — Toggle auto-scan on/off\n"
"/status — Bot status\n" "/status — Bot status\n"
"/cache — Show data cache age per pair/TF\n" "/cache — Show data cache age per pair/TF\n"
@@ -751,7 +746,7 @@ async def cmd_autoscan(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
next_h4 = _seconds_until_boundary(240, buffer=10) next_h4 = _seconds_until_boundary(240, buffer=10)
await update.message.reply_text( await update.message.reply_text(
"✅ *Auto-scan enabled*\n\n" "✅ *Auto-scan enabled*\n\n"
f"Scanning XAU/USD + EUR/USD on M5/M15/H1/H4 at candle close.\n" f"Scanning EUR/USD on M5/M15/H1/H4 at candle close.\n"
f"📊 Live dashboard refreshes every {_DASHBOARD_REFRESH_INTERVAL}s.\n" f"📊 Live dashboard refreshes every {_DASHBOARD_REFRESH_INTERVAL}s.\n"
f"📡 Live price monitoring active.\n" f"📡 Live price monitoring active.\n"
f"Next: M5 {next_m5 / 60:.0f}m | M15 {next_m15 / 60:.0f}m | " f"Next: M5 {next_m5 / 60:.0f}m | M15 {next_m15 / 60:.0f}m | "
@@ -801,7 +796,7 @@ async def cb_scan(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
) )
async def _cb_scan_all(query, symbol: str = XAUUSD) -> None: async def _cb_scan_all(query, symbol: str = EURUSD) -> None:
display = PAIR_INFO.get(symbol, {}).get("display", symbol) display = PAIR_INFO.get(symbol, {}).get("display", symbol)
await query.edit_message_text( await query.edit_message_text(
f"⏳ Scanning {display} across M5 / M15 / H1 / H4…", f"⏳ Scanning {display} across M5 / M15 / H1 / H4…",
@@ -869,7 +864,7 @@ async def _post_init(app: Application) -> None:
"""Register command menu and start scheduler on boot.""" """Register command menu and start scheduler on boot."""
await app.bot.set_my_commands([ await app.bot.set_my_commands([
("start", "Welcome & scan buttons"), ("start", "Welcome & scan buttons"),
("scan", "Quick scan buttons (XAU/USD + EUR/USD)"), ("scan", "Quick scan buttons (EUR/USD)"),
("autoscan", "Toggle auto-scan on/off"), ("autoscan", "Toggle auto-scan on/off"),
("status", "Bot status, WS connection, live prices"), ("status", "Bot status, WS connection, live prices"),
("cache", "Show data cache age per pair/TF"), ("cache", "Show data cache age per pair/TF"),
@@ -918,7 +913,7 @@ async def _post_init(app: Application) -> None:
await app.bot.send_message( await app.bot.send_message(
chat_id, chat_id,
f"🤖 *ForexBot2 started*\n\n" f"🤖 *ForexBot2 started*\n\n"
f"Auto-scanning XAU/USD + EUR/USD on M5/M15/H1/H4.\n" f"Auto-scanning EUR/USD on M5/M15/H1/H4.\n"
f"📊 Live dashboard refreshes every {_DASHBOARD_REFRESH_INTERVAL}s.\n" f"📊 Live dashboard refreshes every {_DASHBOARD_REFRESH_INTERVAL}s.\n"
f"📡 Live price monitoring active.\n" f"📡 Live price monitoring active.\n"
f"Next: M5 {next_m5 / 60:.0f}m | M15 {next_m15 / 60:.0f}m | " f"Next: M5 {next_m5 / 60:.0f}m | M15 {next_m15 / 60:.0f}m | "